Setting up a Database in a RONIN Machine

Setting up a database in a RONIN machine and connecting to that machine from another RONIN machine is really simple within a project.

Setting up a Database in a RONIN Machine

Setting up a database in a RONIN machine and connecting to that machine from another RONIN machine is really simple within a project. We made all the networking friendly within projects so the machines are already able to connect to each other. For this example we will use Postgresql.

If you haven't launched a Docker machine on RONIN, you'll want to read the Create and connect to a Docker machine article on how to do so before returning here

I have created and connected my Docker machine already, let's get started!

Step 1 - Install Postgresql

Run in a terminal.

sudo apt install postgresql -y
Step 2 - Modify the pg_hba config file:
sudo bash -c 'echo -e "host\tall\t\tall\t\t0.0.0.0/0\t\tmd5" >> /etc/postgresql/10/main/pg_hba.conf'
Step 3 - Modify the postgressql config file:
sudo bash -c 'echo -e "listen_addresses='\''*'\''" >> /etc/postgresql/10/main/postgresql.conf'
Step 4 - Restart the Postgres service
sudo service postgresql restart
Step 5 - Create a new super user

Run the following command in your terminal window, and enter the following prompts.

First log in as the postgress user.

sudo su - postgres

Then run the following command

createuser --interactive --pwprompt
  • At the 'Enter name of role to add:' prompt, type the desired role name. e.g. Admin
  • At the 'Enter password for new role:' prompt, type the desired password for the user role.
  • At the 'Enter it again:' prompt, retype the password.
  • At the 'Shall the new role be a superuser?' prompt, type 'y'.
Step 6 - Go to the PGADMIN UI and connect to your server with your new super user credentials
pgAdmin4 welcome page

Yay!!! You now have connected your database to your RONIN machine.

celebrate