I enjoy installing PostgreSQL directly on bare metal servers, without any additional overhead from Docker containers, to get pure bare metal performance.
Sorry for the late reply
Edit the postgresql.conf file: Find the data_directory parameter and set it to the new path you want to use. For example: data_directory = '/new/data/path'
To add on, you can run commands like df -h Show mounted filesystems along with disk usage lsblk List all block devices along with information like mountpoints, size, type
Haha , that is one of the reason why i started blogging because i realise i'm going through the same process multiple times these years. Glad you got it figured out!
Nope, for listen_addresses it's to allow remote connection, .e.g your wanna use PGADMIN to connect to DB, you kinda need that, make sure you see a good password
With regards to the firewall, you can always use your VPS's firewall too e.g. DigitalOcean / AWS , almost all service provider will provide firewall for free.
I think there is a typo. It is:
sudo apt install gnupg2 wget vimShould be:
sudo apt install gnupg2 wget nanoI mean you do use nano, thankfully 😉
Updated, Thank you! HAHA Yeah , takes me minutes to exit vim , hehe
In my case, it was
sudo apt install gnupg2 wget geditGUI for the win.
I enjoy installing PostgreSQL directly on bare metal servers, without any additional overhead from Docker containers, to get pure bare metal performance.
I run this to create a
rootrole (to match with myrootuser on ubuntu 20.04) so I don't have to switch topostgresuser to usepg_restore.nice post:)
Small additions:
sudo systemctl enable postgresqlshould be prior tosudo systemctl start postgresqlhi sorry for the n00b question, but how do i change the default data directory? as i am looking to install a 1TB db that will exceed my boot/os drive
Sorry for the late reply
Edit the postgresql.conf file: Find the data_directory parameter and set it to the new path you want to use. For example:
data_directory = '/new/data/path'To add on, you can run commands like
df -hShow mounted filesystems along with disk usagelsblkList all block devices along with information like mountpoints, size, typeyah that didnt quite work for me. I did end up figuring it out though, from virgin install to new custom directory took 27 steps :/
Haha , that is one of the reason why i started blogging because i realise i'm going through the same process multiple times these years. Glad you got it figured out!
is sudo ufw allow 5432/tcp a security risk? or listen_addresses = '*'?
Nope, for listen_addresses it's to allow remote connection, .e.g your wanna use PGADMIN to connect to DB, you kinda need that, make sure you see a good password
With regards to the firewall, you can always use your VPS's firewall too e.g. DigitalOcean / AWS , almost all service provider will provide firewall for free.
At step 1.2 upon entering the code, I am asked to put deb name. Instructions don't specify what to do in this step.