# Install a Database

Learn how to install the database that FusionAuth will use to store user data.

> For the index of this section of the site, see [llms.txt](https://fusionauth.io/docs/llms.txt)

FusionAuth requires a database that meets the [System Requirements](https://fusionauth.io/docs/deploy/production/system-requirements.md). This page explains how to install a supported database.

To install PostgreSQL, follow the installation instructions for your platform at [postgresql.org](https://www.postgresql.org/download/). We recommend PostgreSQL 15 or newer.

If you don't have PostgreSQL installed, you can install it using Homebrew:

1.  Install PostgreSQL:
    
    ```shell-session
    $  brew install postgresql@16
    ```
    
2.  Start PostgreSQL with Homebrew services:
    
    ```shell-session
    $  brew services start postgresql@16
    ```
    
3.  Add the following line to your `~/.zshrc` or `~/.bashrc` file to add PostgreSQL binaries to your `PATH`:
    
    ```shell-session
    $ export PATH="$PATH:$(brew --prefix postgresql@16)/bin"
    ```
    

Then, configure PostgreSQL for use with FusionAuth:

1.  Create the FusionAuth user, `fusionauth`, with password `fusionauth`:
    
    ```shell-session
    $ psql --command="CREATE USER fusionauth PASSWORD 'fusionauth'" --command="\du" postgres
    ```
    
2.  Create a database named `fusionauth` owned by the `fusionauth` user:
    
    ```shell-session
    $ createdb --owner=fusionauth fusionauth
    ```
    

To install MySQL, follow the installation instructions for your platform at [dev.mysql.com](https://dev.mysql.com/downloads/installer/).

FusionAuth requires the ability to store 4-byte unicode. To store 4-byte unicode, you must configure your MySQL server to use the `utf8mb4` character set. If you don't configure this character set, FusionAuth will fail to start and log an error.

1.  To configure your MySQL instance to use `utf8mb4`, add the following lines to `my.cnf` (`my.ini` on Windows):
    
    ```ini
    [client]
    default-character-set = utf8mb4
    
    [mysql]
    default-character-set = utf8mb4
    
    [mysqld]
    character-set-client-handshake = FALSE
    character-set-server = utf8mb4
    collation-server = utf8mb4_bin
    ```
    
2.  After modifying the configuration file, restart MySQL to load your changes.
    

This configuration changes the character set for the entire MySQL server. If you share your MySQL server across multiple databases and applications, check to ensure that this change doesn't impact functionality.

Once you have configured the available options, if startup still fails due to this validation, you may disable this feature. See `database.mysql.enforce-utf8mb4` in the [Configuration reference](https://fusionauth.io/docs/deploy/production/configuration.md).

To use MySQL with FusionAuth, you also need the MySQL Connector for Java. This is a manual process due to the way that Oracle licenses MySQL. To get the MySQL Connector into the correct location for FusionAuth:

1.  Download the MySQL Connector version 8.0.23 or newer using the Platform Independent installer from [Oracle](https://dev.mysql.com/downloads/connector/j/8.0.html).
2.  Unzip or untar the archive.
3.  The archive should contain a file named `mysql-connector-java-<version>.jar`. Copy this file to the FusionAuth app library directory, located in the installation directory at `fusionauth-app/lib`. For example, a DEB package install on a Debian Linux system would locate the installation directory at `/usr/local/fusionauth/fusionauth-app/lib`.

Related

[Deploy Configuration Reference Learn about the configuration options for FusionAuth. database configuration](https://fusionauth.io/docs/deploy/production/configuration.md)
---

## Other pages in Install

> For the full index of this section, see [Deploy](https://fusionauth.io/docs/llms-deploy.txt).

- [Air-gapping](https://fusionauth.io/docs/deploy/production/install/air-gapping.md): Run FusionAuth with no network access (air-gapped).
- [Customize Docker Images](https://fusionauth.io/docs/deploy/production/install/docker-configuration.md): Learn how to configure a Docker image containing FusionAuth to meet the needs of your application.
- [Install FusionAuth App](https://fusionauth.io/docs/deploy/production/install/fusionauth-app.md): Learn how to install FusionAuth App on a production server with Docker or from a package.
- [Packages](https://fusionauth.io/docs/deploy/production/install/packages.md): Learn how to determine which installation packages you need.
- [Install a Search Engine](https://fusionauth.io/docs/deploy/production/install/search.md): Learn how to install a search engine for your FusionAuth instance.
- [Silent Mode](https://fusionauth.io/docs/deploy/production/install/silent-mode.md): This is a guide to using silent mode during FusionAuth install and updates.
