Skip to main content

Create a PostgreSQL, MySQL, MongoDB or Redis database

This page shows how to create a managed database on Cloider with each of the five tools, what every setting means, which names are allowed, and how to fix the errors you can get. A new database is usually ready to accept connections a few minutes after you create it.

Before you begin​

  • You need a Cloider account. See create an account.
  • Your role in the account must allow changes. Members with read-only access can't create databases, see access control.
  • For the CLI, install the CLI and run cloider login.
  • For Terraform, the REST API and the CLI in CI, create an API token with Read & Write access.
  • For MCP, set up the MCP server in your AI client.
  • On the free plan, an account can have one database at a time. See billing.

What you choose when you create a database​

SettingWhat it isCan it change later?
NameThe database's name. It is the name of the database inside the engine (for PostgreSQL, MySQL and MongoDB) and part of its host name, <name>-<id>.db.cloider.comNo
UsernameThe user your application connects as. The password is generated for youNo
Engine and versionPostgreSQL 18, MySQL 9, MongoDB 8 or Redis 8. See which engine to chooseNo
Trusted sourcesWho may connect: anywhere, IPv4 addresses or ranges, your apps, your clusters. See trusted sourcesYes, any time
SSL modeWhether connections use TLS. See SSL/TLSYes, with a short restart
PlanCPU, RAM and storage. See plans and sizesYes, to a larger plan only. See resize

The database also gets a label, the name it is shown and found by in the dashboard and the CLI. The label starts as the name, and gets a -1, -2 and so on suffix when another database in the account already has that label. You can rename a database's label at any time.

Create a database​

  1. Open Databases in the sidebar and click Create Database.
  2. In Database Name, type a name, for example orders-db.
  3. Database Username fills itself in from the name (orders_db_user). Change it if you want another user name.
  4. In Database Engine, choose the engine and version, for example PostgreSQL v18.
  5. In Trusted sources, keep Allow Everything or choose who may connect: Allow My IP, one of your clusters or apps, or type an IPv4 range in CIDR format such as 203.0.113.0/24 and press Enter.
  6. Leave SSL Mode on to require encrypted connections. It is on by default for PostgreSQL, MySQL and MongoDB, and off for Redis.
  7. Under Select a Plan, pick a plan. The table shows each plan's monthly and hourly price, RAM, CPUs and storage.
  8. Click Create database.
The Create new database form with the name orders-db, the username orders_db_user, PostgreSQL v18 selected, Allow Everything as trusted source, SSL Mode on and the plan table
The new database form. The plan table appears once you choose an engine.

The dashboard takes you back to the Databases list, where the new database is highlighted with the status Creating. The status changes to Ready on its own, and the name becomes a link to the database's page.

What happens after you create a database?​

Cloider provisions the database in the background. Its status goes through these steps:

  1. Creating: Cloider creates the database server, its storage volume, the user and password, the TLS certificate (when SSL is on), the public and private endpoints and the firewall rules for your trusted sources.
  2. Ready: the database accepts connections. Its page in the dashboard opens, and the Terminal tab appears.

Creation usually takes a few minutes. The first full backup is taken the first night after the database is created, so the Backups tab says "You can restore a backup after the first full backup is completed." until then.

Verify​

Check that the status is Ready:

cloider db status orders-db
Output
Ready

Then show the connection details and run a first query without installing anything:

cloider db get orders-db
cloider db exec orders-db "SELECT current_database(), current_user;"
Output
current_database | current_user
------------------+----------------
orders-db | orders_db_user
(1 row)

Next, connect from your machine or your app.

Naming rules​

The name and the user are checked when you create the database. Both can't be changed afterwards.

Database name rules​

  • 2 to 64 characters.
  • Lower case letters (a to z), digits and hyphens (-) only. No spaces, upper case letters or other characters.
  • Starts with a letter (not a digit, not a hyphen) and doesn't end with a hyphen.
  • Not a reserved name: mysql, information_schema, performance_schema, sys, postgres, template0, template1, admin, local or config.

Names don't have to be unique: two databases can share a name, and they are told apart by their id and label. The name is part of the host name, so a short name is easier to type.

Hyphens in SQL

A name with a hyphen, such as orders-db, works as is in connection strings and client flags (psql -d orders-db). Inside SQL, quote it: "orders-db" in PostgreSQL and `shop-db` in MySQL.

Username rules​

  • 2 to 64 characters.
  • Lower case letters, digits and underscores (_) only. Hyphens aren't allowed.
  • Starts with a letter and doesn't end with an underscore.
  • Not a reserved user: root, mysql, postgres or admin.

The dashboard, CLI and Terraform suggest <name>_user, with hyphens turned into underscores: orders-db gets orders_db_user.

Label rules​

The label follows the database name rules (2 to 64 lower case letters, digits and hyphens, starting with a letter), without the reserved names, and it must be unique among the account's databases.

Defaults by tool​

The tools pick slightly different defaults when you leave a setting out:

SettingDashboardCLITerraformAPIMCP
PlanHobbyHobbyhobbyRequiredHobby
VersionThe one listedThe newestThe newestRequiredThe newest
User<name>_user<name>_user<name>_userRequired<name>_user
SSLOn, except RedisOn, except RedisOn, except RedisOffOn, except Redis
Trusted sourcesAllow Everything*["*"]None (unreachable)*

How do I rename a database?​

You can change a database's label, the name it is shown and found by, without touching its host, user or database name.

  1. Open the database's page.
  2. Click its name in the breadcrumb at the top, type the new label and confirm.

Troubleshooting​

Database name must not have special characters except "-"​

The name contains a character other than lower case letters, digits and hyphens, for example an underscore or a dot. Use hyphens: orders-db, not orders_db. The other name errors are just as literal: Database name can not be upper case, Database name can not start with numbers, Database name must not have spaces, Database name must be at least 2 characters, Database name must not exceed 64 characters and Database name is reserved.

Database username must not have special characters except "_"​

The user contains a hyphen or another character. Use underscores: orders_db_user. Other user errors: Database username can not be upper case, Database username can not start with numbers, Database username must not start with any special character, Database username must not end with any special character and Database username is reserved (for root, mysql, postgres and admin).

Invalid database version!​

The version doesn't exist for the engine. PostgreSQL takes 18, MySQL 9, MongoDB and Redis 8. In the CLI, leave --version out to get the newest.

Invalid database plan​

The plan isn't one of Hobby, Starter, Basic, Standard, Plus or Pro. The API expects the capitalized name. The CLI and Terraform accept lower case.

database engine must be selected!​

The request has no service. In the dashboard, choose an option in Database Engine.

This database engine isn't available at the moment!​

The engine can't be created right now. cloider pricing lists the engines that can.

Free plan users can not create more than one database. UPGRADE NOW!​

Accounts on the free plan can have one database at a time. Delete the existing one or upgrade, see billing.

You have read-only access to this account, you can not create databases!​

Your role in the account, or your API token, is read-only. Ask an account owner for a role that can make changes, or use a Read & Write token.

Your account is suspended. Upgrade to a paid plan to continue using our services.​

The account is suspended, for example after the trial ended. See billing.

The database stays in Creating​

Creating usually takes a few minutes. If it is still Creating after 20 minutes, contact support with the database's id (cloider db list -o wide shows it).

Next steps​

Frequently asked questions

How long does it take to create a database on Cloider?

A new database is usually ready a few minutes after you create it. Its status changes from Creating to Ready, and cloider db create --wait returns when it is ready.

Can I change the database name or user after creating it?

No. The name, user, engine and version are fixed when the database is created. You can change its label (the name shown in the dashboard), its plan (larger only), its trusted sources and its SSL mode.

What is the default password of a Cloider database?

There is no default password. Cloider generates a random 32 character password for the database user. Show it on the database's Overview tab or with cloider db password <database>.

What does a new Cloider database contain?

A new PostgreSQL, MySQL or MongoDB database comes with one database named after it and one user, both created for you. A new Redis database comes with one user and the standard numbered Redis databases, starting at 0. To keep the data of two projects fully apart, create a Cloider database for each.

Who can connect to a new database by default?

The dashboard, CLI, Terraform and MCP create databases that trust every source (Allow Everything), protected by the password and, when SSL is on, TLS. Restrict trusted sources to your IPs, apps and clusters for production. A database created through the API with no trusted sources can't be reached until you add some.