Netbox installation
  • Prerequisites
  • PostgreSQL Installation
  • Redis Installation
  • NetBox Installation
  • Gunicorn Configuration
  • HTTP Server Setup
  • Playbook - Ansible
Powered by GitBook
On this page
  • PostgreSQL Instalattion
  • PostgreSQL Configuration
  • PostgreSQL Version Check
  • Database Creation
  • Verify Service Status

PostgreSQL Installation

PostgreSQL Instalattion

sudo apt install -y postgresql

PostgreSQL Configuration

PostgreSQL Version Check

  1. Verify that you have installed PostgreSQL 11 or later.

psql -V

Database Creation

  1. Start by invoking the PostgreSQL shell as the system Postgres user.

sudo -u postgres psql
  1. Within the shell, enter the following commands to create the database and user (role), substituting your own value for the password.

CREATE DATABASE netbox;
CREATE USER netbox WITH PASSWORD 'password';
ALTER DATABASE netbox OWNER TO netbox;
  1. Once complete, enter \q to exit the PostgreSQL shell.

Verify Service Status

  1. You can verify that authentication works by executing the psql command and passing the configured username and password. (Replace localhost with your database server if using a remote database.).

$ psql --username netbox --password --host localhost netbox
Password:
psql (14.8 (Ubuntu 14.8-0ubuntu0.22.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.

netbox=> \conninfo
You are connected to database "netbox" as user "netbox" on host "localhost" (address "127.0.0.1") at port "5432".
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
netbox=> \q
  1. If successful, you will enter a netbox prompt. Type \conninfo to confirm your connection, or type \q to exit.

PreviousPrerequisitesNextRedis Installation

Last updated 1 year ago