Skip to content
Shellbay

Databases · about 1 min · 4 steps

Create a PostgreSQL database

Creates a new PostgreSQL database and a login that owns it, with a random password saved in a file only root can read.

Runs on

  • Debian / Ubuntu: supported
  • RHEL / Fedora: supported
  • Alpine: supported

Before you start

  • Run the PostgreSQL workflow first.

What it changes on your server

  • Creates the database, owned by the login you name. Other logins can't connect to it.
  • Creates that login with a random password if it doesn't exist yet, and saves the details in /root/shellbay-postgres-<database>.txt (root only). An existing login keeps its password.
  • If pg_hba.conf only allows ident sign-in from 127.0.0.1 (the RHEL default, which rarely works), switches those lines to passwords. A backup of the file is kept.

What Shellbay asks you

  1. Name the database and its login

    Use lowercase letters, digits and _, starting with a letter. Apps usually get their own database and login, often with the same name. If the login already exists it becomes the owner and keeps its password.

    Database name
    Text, up to 63 characters
    Owner login
    Text, up to 63 characters

    Example: shop

Steps

  1. Check the names and the server
  2. Create the login and the database
  3. Allow password sign-in from this server
  4. Check the database and login

Shellbay checks the server before the first step, and stops at the first step that fails.

When it's done

  • The database ‹database name› is ready, owned by ‹owner login›.
  • If Shellbay created the login, its password and a connection URL are on the server: run sudo cat /root/shellbay-postgres-‹database name›.txt. Copy them into your app's settings.