You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/configure-netbox-managed-postgresql-database/index.mdx
+35-41Lines changed: 35 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ categories:
10
10
- postgresql-and-mysql
11
11
hero: assets/scaleway_netbox.webp
12
12
dates:
13
-
validation: 2024-10-29
13
+
validation: 2025-05-14
14
14
posted: 2019-11-14
15
15
---
16
16
@@ -24,30 +24,20 @@ In this tutorial, you learn how to install and configure NetBox on an Instance r
24
24
-[Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
25
25
- An [SSH key](/organizations-and-projects/how-to/create-ssh-key/)
26
26
- An [Instance](/instances/how-to/create-an-instance/) running Ubuntu Focal Fossa (20.04 LTS) or later
27
-
- A [Database for PostgreSQL](/managed-databases-for-postgresql-and-mysql/quickstart/)
27
+
- A [Managed Database for PostgreSQL](/managed-databases-for-postgresql-and-mysql/quickstart/)
28
28
29
29
## Configuring the database
30
30
31
31
NetBox requires a PostgreSQL database. Configure your [Database for PostgreSQL](https://www.scaleway.com/en/database/) with a few steps from your [Scaleway console](https://console.scaleway.com/rdb/instances)
32
32
33
33
1. Enter the Databases section of your [Scaleway console](https://console.scaleway.com/rdb/instances) by clicking on **Managed Databases** in the side menu.
34
-
2. Click the name of the Database you want to use to view the Instance's details:
2.[Create a Database Instance.](/managed-databases-for-postgresql-and-mysql/how-to/create-a-database/)
35
+
3.[Create a database](/managed-databases-for-postgresql-and-mysql/how-to/add-a-database/) called `netbox`.
36
+
4.[Create a new user](/managed-databases-for-postgresql-and-mysql/how-to/add-users/) also called `netbox` and grant it ALL permissions to the `netbox` database.
47
37
48
38
## Installing NetBox
49
39
50
-
1.Log into your Instance using [SSH](/instances/how-to/connect-to-instance/).
40
+
1.Connect to your Instance using [SSH](/instances/how-to/connect-to-instance/).
51
41
2. Update the `apt` package cache and upgrade the software already installed on the Instance to the latest version available in Ubuntu's repositories:
52
42
```
53
43
apt update && apt upgrade -y
@@ -56,13 +46,13 @@ NetBox requires a PostgreSQL database. Configure your [Database for PostgreSQL](
4. Download the [latest release](https://github.com/netbox-community/netbox/releases/latest) of NetBox. At the time of writing this tutorial, it is version 3.7.5. Unpack it into the `/opt` directory:
49
+
4. Download the [latest release](https://github.com/netbox-community/netbox/releases/latest) of NetBox. At the time of writing this tutorial, it is version 4.3.1. Unpack it into the `/opt` directory:
60
50
```
61
-
wget https://github.com/netbox-community/netbox/archive/refs/tags/v3.7.5.tar.gz && tar -xzf v3.7.5.tar.gz -C /opt
51
+
wget https://github.com/netbox-community/netbox/archive/refs/tags/v4.3.1.tar.gz && tar -xzf v4.3.1.tar.gz -C /opt
62
52
```
63
53
5. Create a symlink from the actual NetBox directory to `/opt/netbox`:
64
54
```
65
-
ln -s /opt/netbox-3.6.3/ /opt/netbox
55
+
ln -s /opt/netbox-4.3.1/ /opt/netbox
66
56
```
67
57
6. Create a new system user for the NetBox application:
68
58
```
@@ -103,29 +93,33 @@ NetBox requires a PostgreSQL database. Configure your [Database for PostgreSQL](
103
93
-`REDIS` specifies the configuration parameters of Redis, an in-memory key-value store required as part of the NetBox installation. For most installations, the default configuration is good enough, and you can leave it as it is. For more information about advanced Redis configuration, refer to the [official documentation](https://docs.netbox.dev/en/stable/configuration/required-parameters/#redis).
104
94
-`SECRET_KEY` specifies a secret cryptographic key that is used to improve the security of cookies and password resets. It should be at least 50 characters long and should not be shared outside the configuration file. You may change the value of the key at any time, resulting in a termination of all active sessions.
105
95
106
-
Enter the key in the configuration file as follows, then save the file and exit your text editor:
The `SECRET_KEY` is not used for hashing user passwords or for the encrypted storage of secret data in NetBox.
105
+
NetBox comes with a script, that you may use to generate a random key:
110
106
111
-
<Messagetype="important">
112
-
The `SECRET_KEY` is not used for hashing user passwords or for the encrypted storage of secret data in NetBox.
113
-
NetBox comes with a script, that you may use to generate a random key:
114
-
```
115
-
python3 /opt/netbox/netbox/generate_secret_key.py
116
-
```
117
-
</Message>
118
-
12. Once NetBox has been configured, proceed with the actual installation by running the packaged upgrade script (`upgrade.sh`):
107
+
```
108
+
python3 /opt/netbox/netbox/generate_secret_key.py
109
+
```
110
+
</Message>
111
+
112
+
12. Once NetBox is configured, proceed with the actual installation by running the packaged upgrade script (`upgrade.sh`):
119
113
```
120
114
/opt/netbox/upgrade.sh
121
115
```
122
116
123
117
This script performs the following actions on your instance:
124
118
125
-
- Creating a Python virtual environment
126
-
- Installing all required Python packages
127
-
- Running database schema migrations
128
-
- Aggregating static resource files on disk
119
+
- Creating a Python virtual environment
120
+
- Installing all required Python packages
121
+
- Running database schema migrations
122
+
- Aggregating static resource files on disk
129
123
130
124
<Messagetype="note">
131
125
The upgrade script may warn you, that no existing virtual environment was detected. As this is a new installation, you can safely ignore this warning.
@@ -150,7 +144,7 @@ NetBox does not come with any default user accounts. Create a first user by comp
150
144
python3 manage.py createsuperuser
151
145
```
152
146
153
-
Enter the `username`, `email`, `password`, and `password confirmation` for the user and confirm by pressing Enter. The following message displays once the user is created: `Superuser created successfully.`
147
+
4.Enter the `username`, `email`, `password`, and `password confirmation` for the user and confirm by pressing Enter. The following message displays once the user is created: `Superuser created successfully.`
154
148
155
149
## Testing the application
156
150
@@ -165,10 +159,10 @@ Enter the `username`, `email`, `password`, and `password confirmation` for the u
165
159
166
160
[gunicorn](https://gunicorn.org/) is a Python [WSGI](https://wsgi.readthedocs.io/en/latest/what.html) HTTP Server for UNIX which will be used to serve the NetBox application to Nginx.
167
161
168
-
1.Copy the gunicorn configuration file from the `contrib` directory to its final destination:
The configuration file shipped with the NetBox application works for most setups, however, if you need some specific settings, refer to the [gunicorn documentation](https://docs.gunicorn.org/en/stable/configure.html).
174
168
@@ -221,7 +215,7 @@ To provide an additional layer of security, NetBox will be running behind a [NGI
221
215
}
222
216
```
223
217
224
-
Save the file and exit the text editor.
218
+
Save the file and exit the text editor.
225
219
3. Create a symlink to enable the new configuration with NGINX:
@@ -97,7 +97,7 @@ Your Zulip is now running, however, it cannot send any email notifications in it
97
97
- Activate TLS for outgoing mails: `EMAIL_USE_TLS = True`
98
98
- Set the SMTP port: `EMAIL_PORT = 587`
99
99
100
-
Save the file by pressing `CTRL`+`O` and leave nano by pressing `CTRL`+`X`.
100
+
Save the file by pressing `CTRL`+`O` and leave nano by pressing `CTRL`+`X`.
101
101
3. Open Zulip's secrets file `/etc/zulip/zulip-secrets.conf` in a text editor like `nano` and add the email password at the end of the file, as shown in the following example:
0 commit comments