You decide which services we may enable for analytics, personalization, and external content.
We use cookies and similar technologies on our website to personalize content, embed external media, and better understand how individual areas are used.
Necessary cookies
These entries support essential functions such as security, stability, and form processing.
Optional sections
AnalyticsMarketingPersonalizationExternal media
Your data may be processed with your consent or on the basis of legitimate interests. In the cookie settings, you can reject or explicitly allow each optional category.
Some services process personal data in third countries. By consenting, you also agree to this transfer. You can find more information in our Privacy Policy.
You can reopen and change your selection at any time. · 1.0.2
Setting Up Databases on a Linux Server – Deploying and Managing Database Services
Discover how to install and configure various databases on Ubuntu and other Linux distributions for improved performance and security → Learn more now
10 November 20265 min read0 Views0 helpful
Introduction
This guide shows you how to install different types of databases. We use Ubuntu 20.04 as the operating system example, but also provide the corresponding commands for other Linux distributions available on our website. These commands must be executed via SSH. If you don’t know how to connect to your server via SSH, please check here: Initial Access (SSH).
FAQ
Frequently asked questions
You can install databases directly via One-Click Apps in the dashboard of your dedicated server by searching for databases in the app catalog and starting the installation with your preferred project, environment, and domain settings.
Make sure your system is up to date by updating your package manager’s packages (e.g., sudo apt update on Ubuntu/Debian).
Feedback
Was this article helpful?
Your feedback helps us prioritize and improve content.
0 of 0 Users found this article helpful.
Personal support
Need more help than the guide provides?
Our ZAP support team knows your product — briefly describe your issue and we'll help you personally.
Navigation
Software
Installing Databases with One-Click Apps
You can install databases directly via One-Click Apps in the dashboard of your dedicated server. After the initial setup of the apps, open the app catalog, search for databases, and start the installation with your preferred project, environment, and domain settings. This allows you to quickly and easily deploy and manage databases without manually working in the command line – while still benefiting from integrated web management, custom domain support, and SSL provisioning where available.
Preparation
Before starting the installation of a database, make sure your system is up to date. Update your package manager’s packages with the following command depending on your operating system:
Depending on which database service you want to install, follow the appropriate instructions:
What is MariaDB?
MariaDB is an open-source relational database management system, originally forked from MySQL. It offers improved performance, security, and continuous development. Notable features include enhanced storage engines and full compatibility with MySQL. We recommend MariaDB over MySQL.
MariaDB Installation
First, ensure that the latest MariaDB version is installed. Some older operating systems like Debian 9 or Ubuntu 18.04 do not provide the latest MariaDB version by default in their package managers. Use the following command to ensure the latest version is used:
After installation, start configuring the server with the following command:
Code
mysql_secure_installation
Now you can configure your MariaDB (MySQL) server by following the instructions and setting a password for your server. You can skip the first prompt by pressing Enter.
Info
The root user is the main user of your MariaDB (MySQL) server!
Next, you will be asked if you want to set a password for the root user. Confirm with y for yes. Then enter the new root password.
Info
Nothing will be displayed while typing the password – this is normal and your password will still be saved. Use a strong password for root and keep it safe.
You will then be asked whether to remove anonymous users from the server. For security reasons, confirm this with y:
Next, decide whether the root user is allowed to connect remotely to the server. For security reasons, disable this option and confirm with y:
Then you can remove the test database that MariaDB ships with by confirming with y, as it is not needed:
At the end, you will be asked if the database privileges should be reloaded. Confirm with y to activate the previously set root password:
Your MariaDB (MySQL) server is now ready to use!
What is Redis?
Redis is an in-memory data store that primarily stores data in key-value format but also supports other formats like lists, JSON, and more. It is known for its speed and delivers responses to requests within milliseconds.
Redis Installation
First, you need to add a repository that enables Redis installation. This step is not necessary for all Linux distributions, only for those listed below. Run the command that matches your OS and version:
After installation, your Redis server is ready! By default, it runs on 127.0.0.1:6379 without a password.
Warning
For Debian/Ubuntu users:
Remember to enable the redis-server service after installation so it starts automatically on server boot. Use the following command:
Code
sudo systemctl enable --now redis-server
What is MongoDB?
MongoDB is a document-oriented NoSQL database designed for scalability and developer agility. It stores data in a JSON-like BSON format, allowing storage of diverse data types. MongoDB supports indexes to reduce response times and stands out by not requiring a predefined schema like MySQL or SQLite, offering flexibility and speed.
MongoDB Installation
Select your operating system from the tabs below to see the appropriate instructions.
Installation on Ubuntu & Debian
First, import the public GPG key for MongoDB with the following command: