### Initialize Database and Enable Service Source: https://github.com/postgres/pgweb/blob/master/templates/pages/download/linux/redhat.html After installing PostgreSQL on RHEL/Rocky/AlmaLinux 10, 9, 8 or Fedora 43+, initialize the database, enable the PostgreSQL service for automatic startup, and start the service. ```bash postgresql-setup --initdb systemctl enable postgresql.service systemctl start postgresql.service ``` -------------------------------- ### Start Local Development Server Source: https://github.com/postgres/pgweb/blob/master/docs/dev_install.rst Run this command in the top directory to start the local development server for pgweb. ```bash ./manage.py runserver ``` -------------------------------- ### Install PostgreSQL Server using DNF Source: https://github.com/postgres/pgweb/blob/master/templates/pages/download/linux/redhat.html Install the PostgreSQL server package from the distribution's default repositories using the dnf command. The version installed depends on the distribution version. ```bash dnf install postgresql-server ``` -------------------------------- ### Install PostgreSQL using apt Source: https://github.com/postgres/pgweb/blob/master/templates/pages/download/linux/debian.html Use this command to install the PostgreSQL version included by default in your Debian distribution. ```bash apt install postgresql ``` -------------------------------- ### Load Initial Data Source: https://github.com/postgres/pgweb/blob/master/docs/dev_install.rst Run this script from the pgweb directory to load initial data into certain tables for your local development setup. ```bash pgweb/load_initial_data.sh ``` -------------------------------- ### Automated PostgreSQL Apt Repository Configuration Source: https://github.com/postgres/pgweb/blob/master/templates/pages/download/linux/debian.html This command automates the setup of the PostgreSQL Apt Repository, allowing access to newer PostgreSQL versions than those included in the Debian distribution. ```bash sudo apt install -y postgresql-common sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh ``` -------------------------------- ### Install Repository Key and Configure Sources Source: https://github.com/postgres/pgweb/blob/master/templates/pages/download/linux/debian.html Manually configure the PostgreSQL Apt Repository by importing the GPG key and creating the sources list file. Replace 'trixie' with your Debian distribution's codename. ```bash sudo apt install curl ca-certificates sudo install -d /usr/share/postgresql-common/pgdg sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc ``` ```text Types: deb deb-src URIs: https://apt.postgresql.org/pub/repos/apt Suites: trixie-pgdg Architectures: amd64 Components: main Signed-By: /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc ``` -------------------------------- ### Manual PostgreSQL Apt Repository Configuration - Import Key Source: https://github.com/postgres/pgweb/blob/master/templates/pages/download/linux/ubuntu.html Steps to manually import the repository key for the PostgreSQL Apt Repository. ```bash sudo apt install curl ca-certificates sudo install -d /usr/share/postgresql-common/pgdg sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc ``` -------------------------------- ### Install PostgreSQL 15 with Homebrew Source: https://github.com/postgres/pgweb/blob/master/templates/pages/download/macosx.html Use this command to install a specific major version of PostgreSQL using Homebrew on macOS. ```bash brew install postgresql@15 ```