DB_URI

Database Url

There are two ways to manage your database

Hosting it on Elephantsql

We recommend to use this method and it's quick and easy

  1. Go to https://www.elephantsql.com/ and create a account..

  2. Verify you email id

  3. Create a free tiny instance

  4. Then go your instance details and copy the url and that url is your DB_URI

Hosting it manually

If you're on debian based distro then simply put this command

sudo apt install postgresql postgresql-contrib -y

Then follows these steps:

Change the user to postgres to change the default ident password:

sudo su - postgres

And then open the PostgreSQL shell:

psql

Set any password you prefer, by running the below SQL:

ALTER USER postgres WITH PASSWORD 'yourpasswordhere';

Create a database:

CREATE DATABASE thunderuserbot;

Now quit PostgreSQL shell:

\q

And for going back to your user:

exit

Now, the DB_URI will be:

 postgresql://postgres:yourpasswordhere@localhost:5432/thunderuserbot

Last updated