(Source)
A few steps:
sudo apt-get install software-properties-common dirmngr wget -qO - https://mariadb.org/mariadb_release_signing_key.asc | sudo apt-key add - nano /etc/apt/sources.list.d/mariadb.list
In mariadb.list
we add the two below lines:
deb [arch=amd64,i386,ppc64el] http://mirror.23media.de/mariadb/repo/10.4/debian stretch main deb-src http://mirror.23media.de/mariadb/repo/10.4/debian stretch main
Then:
apt-get update apt-get install mariadb-server