Deploy your first database

Deploying your first database in Coolify helps you validate database creation, credentials, port mapping, and terminal access in a simple flow.

In this guide, you will deploy Redis from the one-click database resources list.

A one-click database is a standalone database resource that Coolify creates from its New Resource > Databases list. Coolify supplies the Redis image, generated credentials, persistent storage, network, and connection details so you can deploy it without writing a Docker Compose file.

The short version

Create or open a project, create a Redis database resource, map a host port, deploy Redis, copy the generated password, and run PING from your terminal.

This path is ideal for a first database deployment because Redis is lightweight and easy to test.


Before you start

Make sure these things are ready before you deploy the database.

Dashboard access

You can sign in to Coolify and see the main dashboard.

  • You can access Coolify in your browser
  • Dashboard loads without errors

Server is connected

Coolify has at least one server listed on the Servers page.

  • Open Servers from the sidebar
  • For self-hosted installs, localhost is fine

Terminal ready

You can run a command from your computer to test Redis.

  • Use redis-cli if installed
  • Use Docker if redis-cli is not installed

If Coolify is not ready yet, first follow Start with Self-hosted or Start with Coolify Cloud.


Deployment overview

First database deployment flow

This first database deployment uses Redis because it is lightweight, quick to deploy, and easy to test from your terminal.

1

Create or open a project

2

Choose Redis

3

Map host port

4

Open firewall

5

Deploy Redis

6

Test with redis-cli

  • Create or open the project where the database will live.
  • Choose Redis from the database resources list.
  • Map a temporary host port for terminal testing.
  • Open the mapped host port in your firewall rules.
  • Deploy Redis and copy the generated password.
  • Run PING from redis-cli and confirm Redis returns PONG.

You should end with a running Redis container, a mapped host port allowed by your firewall, a Redis password, and a successful PONG response.

Databases run as containers

Coolify deploys databases as containers. For this guide, Coolify will create and run a Redis container, generate credentials, and keep the database data on the server.

The Redis container listens on port 6379 internally. You will map a temporary host port so your terminal can connect to it for testing.


Deploy your first Redis database

Choose the deployment method you want to use. Each tab reaches the same first-deployment outcome.

Create your first project

On the Coolify dashboard:

  • click New Project
  • enter a project name, for example my-first-project
  • click Continue
Tip

If you already have a project, skip this step and continue to Step 2.

Create a new resource

Open your project and click Create New Resource.

A resource is something Coolify will run for you, such as an app, database, or service. In this guide, the resource will be a Redis database.

Choose Redis from the database list

In the resource list:

  • search for Redis
  • click Redis

Coolify will create a Redis database resource with generated settings and credentials.

Configure port mapping

Set a temporary port mapping so you can connect from your terminal.

Example:

6380:6379
Redis port mapping

Host port

6380
  • This is the server port you connect to from your terminal.
  • Choose another free host port if 6380 is already used.

Container port

6379
  • This is the Redis port inside the container.
  • Keep this side as 6379 for this guide.

Open the mapped host port on your firewall

Port mapping publishes Redis on the server, but your firewall or cloud provider may still block incoming traffic.

Open the mapped host port, for example TCP 6380, wherever you manage firewall rules for the server running Redis. This is different for each provider and server setup, so check your provider firewall, security group, or server firewall configuration.

For safer testing, allow the port only from your own IP address and close it again when you are done. For general guidance, see Firewall.

Do not expose databases casually

Exposing a database port publicly is risky in production. This guide maps a Redis port only so you can test the first deployment from your terminal.

For real production workloads, keep databases private unless you have a specific reason and strict network controls.

Start Redis

Click Start.

After deployment, keep these values ready:

  • server IP address
  • mapped host port, for example 6380
  • Redis password from the Coolify dashboard

Connect to Redis from terminal

Use redis-cli from your terminal:

redis-cli --user default -h <server-ip> -p <host-port> -a "<redis-password>"

Example:

redis-cli --user default -h 203.0.113.10 -p 6380 -a "your-password"

Then run:

PING

If everything is working, Redis returns:

PONG
No redis-cli installed?

Run redis-cli from a temporary Redis container instead:

docker run --rm -it redis:alpine redis-cli --user default -h <server-ip> -p <host-port> -a "<redis-password>" PING

If the connection works, it returns PONG.


Common first-deploy issues

Use these checks when Redis deploys but the terminal test does not behave as expected.

Usually means Redis is not reachable on the host port you are using.

Check:

  • Redis deployment is in running state
  • Ports Mappings uses the host port you are connecting to
  • your server firewall allows the mapped host port
  • you are using the server IP address, not the Redis container IP

What to do next

Your first database confirms that Coolify can create a database, generate credentials, expose a test port, and accept a connection.

On this page