diff --git a/contrib/netbox-rq.service b/contrib/netbox-rq.service index 58662dccf..77d70910c 100644 --- a/contrib/netbox-rq.service +++ b/contrib/netbox-rq.service @@ -7,9 +7,8 @@ Wants=network-online.target [Service] Type=simple -User=www-data -Group=www-data - +User=netbox +Group=netbox WorkingDirectory=/opt/netbox ExecStart=/opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py rqworker diff --git a/contrib/netbox.service b/contrib/netbox.service index 076879254..18eb0457c 100644 --- a/contrib/netbox.service +++ b/contrib/netbox.service @@ -7,8 +7,8 @@ Wants=network-online.target [Service] Type=simple -User=www-data -Group=www-data +User=netbox +Group=netbox PIDFile=/var/tmp/netbox.pid WorkingDirectory=/opt/netbox diff --git a/docs/installation/3-netbox.md b/docs/installation/3-netbox.md index b58391769..1e1964fe7 100644 --- a/docs/installation/3-netbox.md +++ b/docs/installation/3-netbox.md @@ -68,10 +68,14 @@ Resolving deltas: 100% (1495/1495), done. Checking connectivity... done. ``` -!!! warning - Ensure that the media directory (`/opt/netbox/netbox/media/` in this example) and all its subdirectories are writable by the user account as which NetBox runs. If the NetBox process does not have permission to write to this directory, attempts to upload files (e.g. image attachments) will fail. (The appropriate user account will vary by platform.) +## Create the NetBox User - `# chown -R netbox:netbox /opt/netbox/netbox/media/` +Create a system user account named `netbox`. We'll configure the WSGI and HTTP services to run under this account. We'll also assign this user ownership of the media directory. This ensures that NetBox will be able to save local files. + +``` +# adduser --system --group netbox +# chown --recursive netbox /opt/netbox/netbox/media/` +``` ## Set Up Python Environment