Adminer Setup



Adminer is a simple front-end for your database server that can be access through the browser

Pre-Requirements

To run adminer, you'll need a webserver with php set up. Thankfully I'm a great guy, and have written about these topics before.

Download the latest release

This will download the latest release to your default web directory, this can be changed, by altering the path following -O.

wget "http://www.adminer.org/latest.php" -O /var/www/html/adminer.php

Set permissions for your web server

chown -R www-data:www-data /var/www/html/adminer.php
chmod 755 /var/www/html/adminer.php

Access it

Head to your /adminer.php, and you should load into the adminer login. Using your mysql/mariaDB credentials, you can then login, and use the GUI to manage your database(s)

Make it a directory, not a file

Instead of accessing /adminer.php?, we can make it look like /adminer/

location /adminer/ {
	root /var/www/html ;
	try_files $uri $uri/ /adminer/index.php/$is_args$args ;
}

Password Protect

An additional level of security, just in case. Using Htaccess, any file, or directory can be password protected

sudo apt install apache2-utils
htpasswd -c /home//.htpasswd admin

Add to location

Add the location of the auth file to the adminer location block

auth_basic "Adminer" ;
auth_basic_user_file /home//.htpasswd ;

They block should look like below

location /adminer/ {
	auth_basic "Adminer" ;
	auth_basic_user_file /home//.htpasswd ;
	root /var/www/html ;
	try_files $uri $uri/ /adminer/index.php/$is_args$args ;
}