Operating System Ubuntu

How to Install Adminer on Ubuntu 26.04 and Debian 13

Install the Adminer database manager on Ubuntu 26.04 LTS or Debian 13 with Apache, from the package or the latest upstream file, and lock down access.

Adminer is a database management tool written in PHP that ships as a single file. Its core supports MySQL, MariaDB, PostgreSQL, CockroachDB, SQLite, MS SQL and Oracle, and plugins add further systems such as Elasticsearch, MongoDB and ClickHouse. This guide installs Adminer behind Apache on Ubuntu 26.04 LTS and Debian 13, either from the distribution package or as the newest upstream release, and then restricts access to it. Differences for Ubuntu 24.04 LTS and Debian 12 are noted.

Which version you get

The distribution packages lag behind the upstream project, which matters because Adminer's developers ask you to update whenever a new version is announced.

SourceAdminer version
Upstream (adminer.org), November 20266.3.0
Ubuntu 26.04 LTS package5.4.1
Debian 13 package5.2.1
Ubuntu 24.04 LTS and Debian 12 packages4.8.1

Use the package if you want updates through apt and can live with an older release. Use the upstream file if you want the current version, and accept that you replace the file yourself when a new one comes out. Current upstream releases require PHP 5.4 or newer with sessions enabled, so the PHP shipped by any of these distributions is fine.

Requirements

  • A server running Ubuntu 26.04 LTS or Debian 13 and a user with sudo rights.
  • A database server to manage (local or remote) and a database account that logs in with a password. Adminer refuses connections without a password.
  • An HTTPS-enabled virtual host if the server is reachable from the internet. Database passwords should never travel over plain HTTP.

Option 1: Install the distribution package

Install Apache, the PHP module, the driver for your database and Adminer. The example uses the MySQL/MariaDB driver; use php-pgsql for PostgreSQL or php-sqlite3 for SQLite.

sudo apt update
sudo apt install apache2 libapache2-mod-php php-mysql adminer

The package installs an Apache configuration snippet but does not enable it. Enable it and reload Apache:

sudo a2enconf adminer
sudo systemctl reload apache2

Adminer is now available at http://203.0.113.10/adminer (replace the address with your server's). On Debian 13 the snippet maps /adminer to the directory /etc/adminer, whose conf.php loads the compiled /usr/share/adminer/adminer.php. That conf.php is also where you enable plugins: the bundled ones are in /usr/share/adminer/plugins, and the file contains a commented example for AdminerLoginServers, which replaces the free-text server field with a fixed list.

Option 2: Install the latest upstream release

Install Apache, PHP and the database driver, then download the current stable file from the project site into its own directory:

sudo apt update
sudo apt install apache2 libapache2-mod-php php-mysql wget
sudo mkdir -p /usr/local/share/adminer
sudo wget https://www.adminer.org/latest.php -O /usr/local/share/adminer/index.php

The project also publishes smaller builds: latest-mysql.php (MySQL and MariaDB only), latest-en.php (English only) and latest-mysql-en.php. Next, tell Apache where the directory is:

sudo nano /etc/apache2/conf-available/adminer-local.conf
Alias /adminer /usr/local/share/adminer

<Directory /usr/local/share/adminer>
    Require all granted
    DirectoryIndex index.php
</Directory>
sudo a2enconf adminer-local
sudo apache2ctl configtest
sudo systemctl reload apache2

To upgrade later, run the same wget command again. Adminer shows a notice in its interface when a newer version exists.

Plugins for an upstream install go into an adminer-plugins/ directory next to the Adminer file; plugins that need settings are configured in an adminer-plugins.php file in the same place, as described in the project's plugin documentation.

Log in

Open /adminer in a browser, choose the database system, and enter the server (localhost for a local database), user name and password. The database field can stay empty.

On Debian and Ubuntu the MariaDB root account authenticates through the local Unix socket instead of a password, so it cannot be used from a web application. Create a separate account for Adminer:

sudo mariadb
CREATE USER 'deploy'@'localhost' IDENTIFIED BY 'choose-a-strong-password';
GRANT ALL PRIVILEGES ON exampledb.* TO 'deploy'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Grant only what the account needs; an account limited to one database is a much smaller risk than one with global privileges.

Restrict access

A database manager open to the whole internet is a constant target for password guessing. Adminer rate-limits login attempts, but the project itself recommends an additional barrier, such as limiting access by IP address or adding web-server password protection.

To allow only your own address, edit the snippet you enabled (/etc/apache2/conf-available/adminer.conf for the package, adminer-local.conf for the upstream file) and replace Require all granted:

Require ip 198.51.100.25

If your address changes often, use HTTP basic authentication instead. Create a password file, then replace the Require line with the four lines below:

sudo apt install apache2-utils
sudo htpasswd -c /etc/apache2/.htpasswd-adminer deploy
AuthType Basic
AuthName "Restricted"
AuthUserFile /etc/apache2/.htpasswd-adminer
Require valid-user

Reload Apache after either change and confirm that a request from another network is refused:

sudo apache2ctl configtest
sudo systemctl reload apache2

When you are not using Adminer for a while, switch it off completely with sudo a2disconf adminer (or adminer-local) and reload Apache.

Troubleshooting

  • The browser downloads the PHP file or shows source code: the PHP module is not active. Make sure libapache2-mod-php is installed and restart Apache.
  • The database system you need is missing from the list or reports no extension: install the matching driver (php-mysql, php-pgsql, php-sqlite3) and restart Apache.
  • 404 on /adminer: the snippet is not enabled; run a2enconf again and reload.
  • Plugins stopped working after a distribution upgrade: Adminer 5 changed its plugin API. Compare your /etc/adminer/conf.php with the version shipped by the new package and re-apply your changes.

Frequently asked questions

Is Adminer still maintained?

Yes. The project publishes frequent releases on GitHub and adminer.org; version 6.3.0 came out in early November 2026, and recent releases have included security fixes. That pace is the main argument for the upstream file over a frozen distribution package.

Can I use Adminer with Nginx?

Yes. Adminer is an ordinary PHP script, so any server block that passes .php requests to PHP-FPM can serve it. Install php-fpm instead of libapache2-mod-php, place the file in a directory served by that block, and apply the same IP or password restriction with Nginx's allow/deny or auth_basic directives.

How do I manage an SQLite database when Adminer insists on a password?

SQLite has no accounts, so Adminer needs to be told which password to accept for it. Upstream handles this with the password-less login plugin (the project also offers a download with it preconfigured for SQLite); the plugin page on adminer.org shows the configuration.

Should I leave Adminer installed on a production server?

Only behind HTTPS and an access restriction, and only while you need it. For occasional use, an SSH tunnel to a copy bound to the loopback interface, or disabling the Apache snippet between sessions, exposes far less.

Share story:

Continue reading other guides on How VPS.