🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)
🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)

🔧 Programmierung 🕛 vor 3 Monaten 4 Min Lesezeit
0

Installing PostgreSQL on Arch Linux | Practical Setup Guide

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Installing postgres on windows/mac is pretty simple, you just follow the steps on the installation wizard and you get it working. You will also find lots of video tutorials and blogs regarding installation in windows/mac. 



But when it comes to linux (specifically arch), things get interesting. Since linux gives you more control, setting up anything on it can seem tricky at first glance but as you go through, you understand each and every step and its purpose. 



Before getting into it, understand this : Postgres is not like MongoDB which you initialize once through the CLI by providing the --dbpath flag, it is a system service. Meaning it will run on the system 24x7 (if we configure it that way) and different system users will be able to use it according to the access they have been granted.









First things first : Installation



Always update the packages first :




CODE
sudo pacman -Syu






Install PostgreSQL:




CODE
sudo pacman -S postgresql






 






Lets initialize a Database Cluster



PostgreSQL requires a data directory initialization. This is the directory which holds the actual data (one-time step unlike MongoDB) :




CODE
sudo -u postgres initdb -D /var/lib/postgres/data







Flags explained



-u postgres → run command as postgres system user initdb → creates system tables & internal structure -D → data directory location




 






Start & Enable Service



Start server:




CODE
sudo systemctl start postgresql






Enable on every boot :




CODE
sudo systemctl enable postgresql






Check status:




CODE
systemctl status postgresql






 






Enter psql Shell



What is psql ? It is a command line interface to interact with out postgres service, databases, relations etc.



Lets enter the psql shell with the user “postgres”. 




On installing postgres, a new user named “postgres” is generated with default privileges.





CODE
sudo -u postgres psql






Why no password?




  • Default auth configuration is the “peer” auth. Peer auth uses our OS user to login

  • OS user identity is trusted



 






Create Role for a Project



It is always a good practice to create a separate role for every major project. This way you follow modular principles.



Inside psql:




CODE
CREATE ROLE myapp WITH
LOGIN
PASSWORD 'devpass123'
CREATEDB;






Meaning:




  • LOGIN → allows authentication

  • PASSWORD → required for apps/ORMs

  • CREATEDB → grant access to create databases



 






Create a Database






CODE
CREATE DATABASE myapp_db OWNER myapp;






Ownership = full control over that DB.



 






Some frequently used and useful psql Commands



List Databases




CODE
\l






 



List roles (users)




CODE
\du






 



List tables/relations




CODE
\d






 



Show current connection details




CODE
\conninfo






 



Show the active role




CODE
SELECT current_user;






 






Connection URL Format



To connect to the database, you will need a url (Yes this is the one you add in your environment variables)



General structure : postgresql://USER:PASSWORD@HOST:PORT/DATABASE



Example : postgresql://myapp:devpass123@localhost:5432/myapp_db



This url can be used by:




  • Prisma

  • ORMs

  • Drivers

  • CLI tools



 






Enable Password Authentication (Critical for Prisma)



Edit config:




CODE
sudo nano /var/lib/postgres/data/pg_hba.conf






Change these lines according to your needs :




CODE
local   all   all                 md5
host all all 127.0.0.1/32 md5
host all all ::1/128 md5






Replace md5 with one of the following :





  • trust → no password


  • peer → OS identity


  • md5 / scram-sha-256 → password-based login



 






Restart PostgreSQL



To apply the config changes :




CODE
sudo systemctl restart postgresql






 






Testing our Connection






CODE
psql "postgresql://myapp:devpass123@localhost:5432/myapp_db"






OR




CODE
psql -U myapp -d myapp_db -h localhost -W







Flags explained



-U → database role -d → database name -h → host (forces TCP) -W → force password prompt




 






Some Common Errors & Causes you might face





  • password authentication failed → wrong password


  • database does not exist → DB missing


  • role does not exist → user missing


  • could not connect to server → service stopped / wrong port



 



Again, remember



PostgreSQL:




  • Always-running service

  • Config-driven behavior

  • URL = connection info only



No manual server start like MongoDB.



 



Happy building 🚀

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Hackers Just Poisoned the Rust Supply Chain | Threat Wire
1 Quelle
Hackers Found a Way Into Humanoid Robots | Threat Wire
1 Quelle
Bits und so #1021 (Passwort für Laufwerk)
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Installing PostgreSQL on Arch Linux | Practical Setup Guide

Thematisch verwandte Begriffe: Installing, PostgreSQL, Arch, Linux · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...