Based on Debian 11 "Bullseye" environment.


Install MariaDB (forked from MySQL). If you need to install PostgreSQL, the process is almost the same as MariaDB. Just install PostgreSQL and related interfaces.


Install, and all set.

# apt install mariadb-server

If you need to access this database from outside of this server, then you have to take care about the firewall and Mariadb user configuration.

Additional security configuration?

You may think you need to do "mysql_secure_installation" or "mysql_install_db" process, but neither of them is necessary.
It's written on /usr/share/doc/mariadb-server-10.5/README.Debian.gz

Interface for PHP / Ruby / Python

To use CMS (e.g. WordPress, ConcreteCMS), you need MySQL (MariaDB) interface modules to connect DB.

# apt install php-mysql ruby-mysql2 python3-mysqldb

Update History


  • Correct some sentences
  • Add explanation for mysql_secure_installation and mysql_install_db
  • Change ruby interface installation from gem to debian package