DEV Community

Cover image for How to install PostgreSQL in Manjaro Linux
Víctor Adrián
Víctor Adrián

Posted on • Originally published at lobotuerto.com on

5 2

How to install PostgreSQL in Manjaro Linux

Installation process

Setting up PostgreSQL in Manjaro Linux is very easy.

Just follow these steps and you’ll have a working installation in no time.

Install the postgresql package:

sudo pacman -S postgresql
Enter fullscreen mode Exit fullscreen mode

Then setup a password for the postgres user with:

sudo passwd postgres
Enter fullscreen mode Exit fullscreen mode

Switch to the postgres user account and initialize the database cluster:

sudo su postgres -l # or sudo -u postgres -i
initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data/'
exit
Enter fullscreen mode Exit fullscreen mode

Options for initdb are as follows:

  • --locale is the one defined in /etc/locale.conf.
  • -E is the default encoding for new databases.
  • -D is the default location for storing the database cluster.

Now, start and enable the postgresql.service:

sudo systemctl enable --now postgresql.service
Enter fullscreen mode Exit fullscreen mode

That’s it!

Links

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (2)

Collapse
 
ismailco96 profile image
ismail courr

Thank you for this tuto 🙏🏻

Collapse
 
moustafa_shaaban profile image
Mostafa Shaaban

Great tutorial, Thank you so much

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs