-
-
Save lindblom/41b3aaaf03f3ef3ebcf8d71dc8615433 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ensure deps | |
sudo apt update | |
sudo apt install wget curl ca-certificates gnupg | |
# add repo to apt | |
wget -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | |
# install postgres | |
sudo apt update | |
sudo apt install postgresql postgresql-contrib | |
# restart postgres | |
sudo systemctl status postgresql | |
# switch to postgres user | |
sudo su - postgres | |
# create application user | |
createuser --interactive --pwprompt | |
# edit postgres.conf | |
vim /etc/postgresql/13/main/postgresql.conf | |
# edit pg_hba.conf | |
vim /etc/postgresql/13/main/pg_hba.conf | |
# exit out of postgres user | |
exit | |
# restart postgres | |
sudo systemctl status postgresql | |
# install postgis if you want it | |
sudo apt install postgis postgresql-13-postgis-3 postgresql-13-postgis-3-scripts | |
# restart postgres again | |
sudo systemctl status postgresql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment