
Adminer is a graphical interface using PHP that allows access to many SQL database types. Adminer also offers the interface in many languages.
Before following this guide, you need an Ubuntu server with PHP 8.1 and Nginx web server.
This article refers to the Adminer server as demo.example.com.
MariaDB is one of the most common database platforms. To install the latest version of MariaDB, update the repository by running:
Install MariaDB, a drop-in replacement for MySQL.
Enable MariaDB to start on boot.
Secure the database. Answer all the security questions as shown.
The secure installer presents you with a series of questions. To ensure an optimal and secure database, answer them as follows:
Adminer is a single file. To install it, create a directory and then download the latest version locally with wget:
Navigate to the login page for your server. For example:
Log in with your MariaDB credentials.
The Adminer page requires a username and password to gain database access but is still available for the entire world to see. To secure the site, restrict access by IP address. You can edit the Nginx config or use the Vultr Firewall.
To restrict access to the Adminer page through the Nginx config:
Find your Nginx config file in /etc/nginx/sites-enabled/.
For example, your file might be demoweb.conf. Open it with an editor.
In the server block, add lines with the IP addresses you want to allow access to the Adminer page. The address can be a single IP address or a CIDR block.
Each line is in the format allow IP_ADDRESS. The last line denies all other IP addresses.
The example configuration above allows access from the IP address 192.0.2.200 and the range from 192.0.2.0 through 192.0.2.15. You can use the Vultr IP Address calculator to find CIDR blocks.
Save and exit the file.
Test the configuration and restart Nginx:
Adminer is a lightweight graphical administrative tool for many databases. To learn more about Adminer, PHP, and how to restrict access by IP address in Nginx, please see these resources:
0 Comments
Be the first to comment and share your perspective with the community.