- Mac Apple Silicon
- Linux
Open Terminal
# brew install postgresql@{{version}}
brew install postgresql@13
Open Terminal
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo systemctl enable postgresql.service
Ensure that the server is running using the systemctl start command:
sudo systemctl start postgresql.service
psql postgres (For Mac) / sudo -u postgres psql (For Ubuntu 20.04)
postgres=# CREATE DATABASE databasename;
postgres=# CREATE USER "username" WITH ENCRYPTED PASSWORD 'password';
postgres=# GRANT ALL PRIVILEGES ON DATABASE databasename TO "username";
postgres=# \q