PostgreSQL Installation Guide
This guide covers the installation and initial setup of PostgreSQL across different operating systems.
Table of Contents
System Requirements
Minimum Requirements
- CPU: 1 GHz or faster
- RAM: 1 GB minimum (4 GB recommended)
- Storage: 10 GB minimum free space
- Operating System: Linux, macOS, or Windows
Recommended Requirements
- CPU: 2 GHz or faster
- RAM: 8 GB or more
- Storage: 50 GB or more free space
- SSD storage for better performance
Installation Methods
Ubuntu/Debian
macOS (using Homebrew)
Windows
- Download the installer from PostgreSQL Downloads
- Run the installer and follow the wizard
- Choose components to install (PostgreSQL Server, pgAdmin, Command Line Tools)
- Set password for the postgres user
- Choose port (default: 5432)
- Complete the installation
Docker
Post-Installation Steps
1. Verify Installation
2. Basic Security Setup
3. Enable Remote Access (Optional)
Edit postgresql.conf
:
Edit pg_hba.conf
:
Troubleshooting
Common Issues
- Connection Refused
- Check if PostgreSQL is running
- Verify port configuration
-
Check firewall settings
-
Authentication Failed
- Verify username and password
- Check pg_hba.conf configuration
-
Ensure proper permissions
-
Port Already in Use
- Check if another PostgreSQL instance is running
- Change port in postgresql.conf
- Kill the process using the port
Getting Help
Next Steps
- Basic Configuration
- Basic Operations
- Security Best Practices