| 1 | = Installing NetBox on Ubuntu 20.04 = |
| 2 | NetBox requires PostgreSQL 10 or later. Please note that MySQL and other relational databases are not supported. |
| 3 | |
| 4 | === PostgreSQL Database Installation === |
| 5 | {{{ |
| 6 | # sudo apt update |
| 7 | # sudo apt install -y postgresql |
| 8 | }}} |
| 9 | |
| 10 | Once PostgreSQL has been installed, start the service and enable it to run at boot: |
| 11 | {{{ |
| 12 | # sudo systemctl start postgresql |
| 13 | # sudo systemctl enable postgresql |
| 14 | }}} |
| 15 | |
| 16 | === Database Creation === |
| 17 | At a minimum, we need to create a database for NetBox and assign it a username and password for authentication. Start by invoking the PostgreSQL shell as the system Postgres user. |
| 18 | {{{ |
| 19 | # sudo -u postgres psql |
| 20 | }}} |
| 21 | |
| 22 | Within the shell, enter the following commands to create the database and user (role), substituting your own value for the password: |
| 23 | {{{ |
| 24 | CREATE DATABASE netbox; |
| 25 | CREATE USER netbox WITH PASSWORD 'netbox123'; |
| 26 | GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox; |
| 27 | }}} |
| 28 | Do not use the password from the example. Choose a strong, random password to ensure secure database authentication for your NetBox installation. |