A long-running and stable database-management system, PostgreSQL - or simply Postgres - can be set up quite as easy as other databases on sloppy.io. Just follow this tutorial.
First, let's set up a new project. For this tutorial, I'm naming it “my-postgres-db”, but you're free to choose for your own purpose. I'm going to divide this project into two services: a “backend” that will contain Postgres and a “frontend” for Adminer, a versatile database administration tool that works well with Postgres.
Postgres has an official release on Docker Hub that goes by the same name. You can select it by typing “postgres” into the Image Path field and picking the first suggestion. Since Postgres will work in the background, it doesn't need a domain name, so tip off “web app” option.
Step 1: Selecting Docker image for PostgreSQL and Environment Variables
Several Environment Variables can be set for Postgres, but to keep things simple for this tutorial, we're just setting a
POSTGRES_USER with a
POSTGRES_PASSWORD. We're going to need the hostname of this app later, so head over to the “Advanced” tab and click “copy” on the bottom entry. Now, you can “Deploy project”.
Step 2: Copy the hostname for your Postgres app
Adminer is sloppy.io's administration tool of choice when it comes to Postgres. The official image name is adminer“ on Docker Hub so just type “adminer” into the Image Path field and it should pop up as a suggestion. Set a domain name for Adminer by using a free subdomain of sloppy.io's own “*.sloppy.zone” or use your own domain.
Step 3: Selecting Docker image for Adminer and domain name
Adminer doesn't make use of Environment Variables, so we need to make the connection to our Postgres database by using the Adminer UI. Since we're done here, click “Deploy [...]” and wait for both the Postgres and Adminer apps to load successfully.
Step 4: Wait for both apps to run successfully
Clicking the link on the Adminer app or heading over to your browser and typing in the domain name you've chosen, you'll see the login screen of Adminer. Here, select “PostgreSQL” as “System” and paste the hostname of your Postgres app you've copied before into the input field next to “Server”. “Username” and “Password” are those you've set as Environment Variables in your Postgres app. Now, you can login and start working.
Step 5: Login to Adminer by using hostname, user and password
Find out how to manage other databases on sloppy.io