# Install
1. PostgreSQL
    You can install PostgreSQL 12 or later
    1. > apt-get install postgresql15-server
    2. > /etc/init.d/postgresql initdb
    3. > systemctl enable --now postgresql
    4. > echo "listen_addresses = 'localhost'" >> /var/lib/pgsql/data/postgresql.conf
    5. > psql -U postgres
        1. -> CREATE DATABASE netbox;
        2. -> CREATE USER netbox WITH PASSWORD 'netbox';
        3. -> ALTER DATABASE netbox OWNER TO netbox;
        The next two commands are needed on PostgreSQL 15 and later
        4. -> \connect netbox;
        5. -> GRANT CREATE ON SCHEMA public TO netbox;
        Verify
            1. > psql --username netbox --password --host localhost netbox
            Output:
                Пароль:
                psql (15.4)
                Введите "help", чтобы получить справку.
            2. -> \conninfo
            Output:
                netbox
                Вы подключены к базе данных "netbox" как пользователь "netbox" (сервер "localhost": адрес "127.0.0.1", порт "5432").
            3. -> \q
2. Redis
    1. > apt-get install redis
    2. > systemctl enable --now redis
    Verify
        1. > redis-cli ping
        Output: PONG
3. Netbox
    1. > vim /etc/netbox/configuration.py
    Change config (min - DB settings and allowed hosts)
    2. > cd /usr/share/netbox
    3. > python3 manage.py migrate
    4. > python3 manage.py createsuperuser
    5. > systemctl enable --now netbox-rq.service
4. HTTP Server
    Option NGINX
        1. > ln -s /etc/nginx/sites-available.d/netbox.conf /etc/nginx/sites-enabled.d/netbox.conf
        2. > systemctl enable --now netbox.service netbox.socket nginx.service
    Option Apache2
        1. > a2enmod ssl proxy proxy_http headers wsgi-py rewrite
        Option HTTP
            1. > a2ensite netbox
        Option HTTPS
            1. > a2enport
                1. -> Your choices are: http http-localhost-8088 https
                2. -> Port config name? https
                Output:
                    Port config https installed;
                        run service httpd2 condreload to fully enable.
            2. > a2ensite netbox-ssl
            3. > systemctl enable --now httpd2.service
# Upgrade
1. > upgrade_netbox
2. Restart the NetBox services
