PostgreSQL
Upload the Project Files
Section titled “Upload the Project Files”Note:PostgreSQL installation is NOT required when deploying the payload using Docker.
-
Install PostgreSQL with the following commands:
sudo apt updatesudo apt install postgresql -
Edit the postgresql.conf file:
sudo nano /etc/postgresql/16/main/postgresql.conf -
Locate the line:
#listen_addresses = 'localhost' -
Uncomment it and change localhost to *:
listen_addresses = '*'This change allows PostgreSQL to listen for connections on all available IP addresses.
-
Edit the pg_hba.conf file:
sudo nano /etc/postgresql/16/main/pg_hba.conf -
Add the following line to the file:
host all all 0.0.0.0/0 md5 -
Configure the Firewall
sudo ufw allow 5432/tcp -
Make sure PostgreSQL is running
sudo service postgresql start -
Connect to PostgreSQL
psql -U postgres -
Create a new database
CREATE DATABASE payload; -
Create a user if you dont have
CREATE USER myuser WITH PASSWORD '1234'; -
Grant All Privileges on the Database
GRANT ALL PRIVILEGES ON DATABASE mydatabase TO myuser; -
Example postgres DATABASE_URI
postgresql://myuser:1234@localhost:5432/payload