
To do this, run the following command: createdb -O cleopatra egypt Next, we will be assigning cleopatra to a database. A superuser is a user that has all the privileges available on a Postgres instance. I named my user role cleopatra and I made my user a superuser. Shall the new role be a superuser? (y/n) y Here is an example: Enter name of role to add: cleopatra While still being logged in as postgres run the following command to create a new user: createuser -interactive -pwpromptĪ prompt will be shown to you asking you to input your desired user role, name, password, and if you want the user to be a superuser. To create a new user, exit the Postgres shell by executing: \q In this step, you will be creating a new user that will be used to access your Postgres database remotely. You will be shown something similar to this: :~$ psql You can access the Postgres shell by running: psql

The server user will be switched from root to postgres. When the process is complete, switch the user to postgres to be able to execute Postgres commands with Postgres default user by running: su - postgres This will install Postgres along with its associated dependencies. When that is done, install Postgres by running: sudo apt-get install postgresql postgresql-contrib

Next, update your server packages and dependencies by running: sudo apt-get update

Then input your relevant user password or SSH key password if any. Server_ip is the IP address of your server Server_user is your server user you would like to log in with The first thing to do is SSH into your server by running: ssh _ip

In this step, you will be installing Postgres on your server.
