Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install MariaDB from your distribution’s packages for the simplest setup, or configure MariaDB’s own repository when you need to choose a particular release series. On Ubuntu, the basic path uses APT; on CentOS-family systems, use the package manager and repository instructions for the exact release—CentOS 7 uses YUM, while most newer RPM-family systems use DNF. After installation, start and verify the service, run the security script, and decide separately whether the server should accept remote connections.

There is no single repository command that fits every Ubuntu and CentOS release, architecture, and MariaDB version. Confirm those details in MariaDB’s current installation guide and the applicable Debian/Ubuntu repository instructions or RPM repository instructions before choosing a MariaDB-managed repository. The commands below distinguish the general distribution-package route from that repository-specific choice.

Choose the installation source before running commands

Two routes are available: use the MariaDB packages provided by Ubuntu or the RPM-family distribution, or configure MariaDB’s own repository to select a MariaDB release series or version. Distribution packages are the straightforward default; MariaDB’s repository is useful when its available versions better match your requirements. The exact supported releases change, so check the live repository setup instructions for your OS release and architecture rather than copying an old codename or repository command.

  • Ubuntu distribution packages: use APT to install mariadb-server and mariadb-client.
  • CentOS-family distribution packages: use the package names and package manager listed for your exact release. MariaDB’s general guide uses DNF or YUM for Red Hat, CentOS, and Fedora-family systems.
  • MariaDB-managed repository: configure the appropriate .deb or RPM repository first, then install from it. Decide whether to track a major series or pin a more specific version.

Do not mix instructions from different repository paths. The generic package names in a distribution quickstart are not interchangeable with the MariaDB-managed RPM package names.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install MariaDB on Ubuntu

Option A: use Ubuntu’s distribution packages

Update APT metadata and install the server and client:

sudo apt update
sudo apt install mariadb-server mariadb-client

This is the short path when the version available from your configured Ubuntu repositories is suitable. The command does not select a MariaDB version explicitly; check the package information for your Ubuntu release if a specific version is a requirement.

Option B: use MariaDB’s .deb repository

If you need to choose a MariaDB release series or pin a version, use MariaDB’s current .deb repository setup instructions. The official guide describes MariaDB Corporation’s repository setup script and MariaDB Foundation’s repository configuration tool, as well as version pinning. Follow the tool’s current output for your Ubuntu codename and architecture, then install the server and client packages specified by that setup.

A repository configuration can affect future updates as well as the initial install. Choose whether to follow a major series or hold to a minor release before installing, and follow the repository guide when changing that choice later.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install MariaDB on CentOS and other RPM-family systems

Use the package manager for the exact release

MariaDB’s general installation guide uses dnf or yum for Red Hat/CentOS/Fedora-family systems. The package manager depends on the release: CentOS 7 uses YUM, while most others use DNF. Confirm the operating system release and the repository source before installing; do not assume a command written for CentOS 7 applies to a newer system.

For a basic distribution-repository installation, the general guide gives this package pattern:

sudo dnf install mariadb mariadb-server

Use the equivalent package-manager command for a YUM-based system, and check the package names available in that release’s configured repositories.

Use MariaDB’s RPM repository

For MariaDB’s own RPM repository, first configure the repository using its current instructions for your distribution and version. The RPM guide gives this basic standalone server installation in that repository context:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo dnf install MariaDB-server

It also lists a broader package set:

sudo dnf install MariaDB-server MariaDB-server-galera galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common

That broader command includes cluster-related and supporting packages; a standalone server does not need Galera simply because it appears in the list. The RPM instructions state that from MariaDB 12.3, Galera Cluster support is no longer included in the base server package and requires MariaDB-server-galera explicitly. Install cluster packages only when the deployment is intended to use Galera.

The RPM repository also supports selecting a major series or pinning a full version. If you change series later, update the repository configuration carefully, particularly if it is pinned to a minor release.

Start the service and confirm that it works

  1. Check service status: sudo systemctl status mariadb. If it is not running, start it with sudo systemctl start mariadb.
  2. Connect locally: use the authentication method configured by the installation. A password-based login can use mariadb -u root -p; on installations using local Unix socket authentication, use sudo mariadb.
  3. Confirm a successful client prompt: once connected, the MariaDB client is communicating with the local server. Exit with exit.

If the service fails to start, inspect the status output and service logs before changing configuration. A successful package installation alone does not prove the server is running or that a client can authenticate.

Run the initial security configuration

Run the included script:

sudo mariadb-secure-installation

The prompts include removing anonymous accounts, root accounts accessible from outside the local host, and the default test database. Review each prompt against how you intend to administer the server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not assume that every MariaDB installation requires setting a root password. MariaDB Documentation notes that from MariaDB 10.4, Unix socket authentication is applied by default and there is usually no need to create a root password. On such systems, local administrative access may use sudo mariadb. Follow the authentication arrangement of your installed version rather than older instructions that always demand a root password.

Configure server options and TLS

Put custom settings in an included option file

MariaDB advises creating a custom configuration file in a directory that the server includes, rather than editing bundled defaults. Its TLS guide gives these example paths:

  • RHEL, CentOS, Rocky Linux, and SLES: /etc/my.cnf.d/z-custom-my.cnf
  • Debian and Ubuntu: /etc/mysql/mariadb.conf.d/z-custom-my.cnf

Check that the directory is included by your installation before relying on a file there. Place server options in a group read by the server, such as [mariadb].

Enable TLS deliberately

TLS is not automatically enabled merely by installing MariaDB. The server needs certificates and keys, and its configuration must identify them. The TLS guide’s example options are ssl_cert, ssl_key, and ssl_ca; configure paths to the certificates you actually provision under the server-readable option group. Restart after changing settings:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo systemctl restart mariadb

Use the official MariaDB TLS configuration guide for the full certificate and server configuration procedure. Protect private keys with permissions that allow the service to read them without making them broadly accessible.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Decide whether remote connections are needed

A newly installed database can be used locally; remote access is a separate networking and security decision. MariaDB’s default port is 3306. Remote clients need a network path and a firewall rule that permits access, but the rule should be limited to intended client hosts or networks rather than exposing the database broadly. Configure TLS when database traffic crosses a network, and create database accounts with only the privileges required for their use.

The installation instructions do not establish one firewall policy suitable for every host. Apply the firewall tooling and access controls used by your operating system and hosting environment, and verify reachability from an intended client after making a deliberate access change.

Common installation and configuration problems

  • Repository setup rejects the OS version or architecture: the selected repository may not support that combination, or the setup input may not match the actual system. Verify the OS release and architecture, then use the current .deb or RPM repository instructions for that exact target.
  • Package names are not found: you may be using MariaDB-managed package names with distribution repositories, or vice versa. Confirm the configured repository and use its corresponding package names.
  • systemctl status mariadb shows the service is stopped: start it with sudo systemctl start mariadb. If it fails, inspect the status and logs for the specific error rather than repeatedly reinstalling.
  • mariadb -u root -p does not authenticate: the installation may use Unix socket authentication rather than a root password. Try local administrative access with sudo mariadb and follow the installed authentication setup.
  • A configuration change has no effect: check that the custom file is in an included configuration directory and that the setting is under a group read by the server. Restart MariaDB after changes that require it.
  • TLS fails to initialize: check that certificate and key paths are correct and readable by the server, and that the CA setting points to the intended certificate authority file. Review the service error output after restart.
  • A remote client cannot connect: local installation does not by itself provide remote connectivity. Check the server’s network configuration and firewall path for port 3306, then confirm that the server and account are configured for the intended remote use.

Or skip the browser setup

MariaDB is a database server, so it does not need a browser screenshot service to install or configure it. For a separate developer task that needs a page capture, ScreenshotNeo offers a one-request screenshot API. The call below saves a WebP capture; see the ScreenshotNeo API documentation for available options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server provides screenshot and page-information tools for AI agents, and its free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots. Learn more at ScreenshotNeo.

Sign up for 1,000 free screenshots a month, with no card required.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.