How to Install NetBox on Your Synology NAS

How to Install NetBox on Your Synology NAS

NetBox is the leading solution for modeling and documenting modern networks. By combining the traditional disciplines of IP address management (IPAM) and datacenter infrastructure management (DCIM) with powerful APIs and extensions, NetBox provides the ideal “source of truth” to power network automation. Available as open source software under the Apache 2.0 license, NetBox is employed by thousands of organizations around the world. In this step by step guide I will show you how to install NetBox on your Synology NAS using Docker.

💡Note: This guide works perfectly with the latest NetBox v3.7.3 release.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Install Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.

  • STEP 3

Make sure you have a synology.me Wildcard Certificate. Follow my guide to get a Wildcard Certificate. If you already have a synology.me Wildcard certificate, skip this STEP.

  • STEP 4

Go to Control Panel / Login Portal / Advanced Tab / click Reverse Proxy. Follow the instructions in the image below.

Netbox Synology NAS Set up 1 new

  • STEP 5

Now click the “Create” button. Follow the instructions in the image below.

Netbox Synology NAS Set up 2 new

  • STEP 6

After you click the Create button, the window below will open. Follow the instructions in the image below.

On the General area, set the Reverse Proxy Name description: type in Netbox. After that, add the following instructions:

Source:
Protocol: HTTPS
Hostname: netbox.yourname.synology.me
Port: 443

Check Enable HSTS

Destination:
Protocol: HTTP
Hostname: localhost
Port: 9458

Netbox Synology NAS Set up 3 new

  • STEP 7

On the Reverse Proxy Rules click the Custom Header tab. Click Create and then, from the drop-down menu, click WebSocket. After you click on WebSocket, two Header Names and two Values will be automatically added. Click Save. Follow the instructions in the image below.

Synology Proxy WebSocket

  • STEP 8

Go to Control Panel / Network / Connectivity tab/ Check Enable HTTP/2 then click Apply. Follow the instructions in the image below.

Netbox Synology NAS Set up 4 HTTP2

  • STEP 9

Go to Control Panel / Security / Advanced tab/ Check Enable HTTP Compression then click Apply. Follow the instructions in the image below.

Netbox Synology NAS Set up 5 HT

  • STEP 10

Go to File Station and open the docker folder. Inside the docker folder, create one new folder and name it netbox. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

NetBox Synology NAS Set up 1

  • STEP 11

Now create three new folders inside the netbox folder that you created at STEP 10 and name them config, db, redis. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

NetBox Synology NAS Set up 2

  • STEP 12

Log into Portainer using your username and password. On the left sidebar in Portainer, click on Stacks then + Add stack. Follow the instructions in the image below.

1 Synology Portainer Add Stack

  • STEP 13

In the Name field type in netbox. Follow the instructions in the image below.

Note: Copy Paste the code below in the Portainer Stacks Web editor.

version: "3.9"
services:
  netbox-redis:
    image: redis
    container_name: NETBOX-REDIS
    hostname: netbox-redis
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping || exit 1"]
    command:
      - sh
      - -c
      - redis-server --appendonly yes --requirepass red-pass
    user: 1026:100
    volumes:
      - /volume1/docker/netbox/redis:/data
    environment:
      - REDIS_PASSWORD=red-pass
    restart: always

  netbox-db:
    image: postgres
    container_name: NETBOX-POSTGRES-DB
    hostname: netbox-db
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "netbox", "-U", "netbox-user"]
      timeout: 45s
      interval: 10s
      retries: 10
    user: 1026:100
    volumes:
      - /volume1/docker/netbox/db:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: netbox
      POSTGRES_USER: netbox-user
      POSTGRES_PASSWORD: netbox-pass
    restart: always

  netbox:
    image: lscr.io/linuxserver/netbox:latest
    container_name: NETBOX
    hostname: netbox
    environment:
      - PUID=1026
      - PGID=100
      - TZ=Europe/Bucharest
      - SUPERUSER_EMAIL=supergate84@gmail.com
      - SUPERUSER_PASSWORD=mariushosting
      - ALLOWED_HOST=netbox.yourname.synology.me
      - DB_HOST=netbox-db
      - DB_PORT=5432
      - DB_NAME=netbox
      - DB_USER=netbox-user
      - DB_PASSWORD=netbox-pass
      - REDIS_HOST=netbox-redis
      - REDIS_PORT=6379
      - REDIS_PASSWORD=red-pass
      - REDIS_DB_TASK=0
      - REDIS_DB_CACHE=1
    volumes:
      - /volume1/docker/netbox/config:/config
    ports:
      - 9458:8000
    restart: always
    depends_on:
      netbox-redis:
        condition: service_healthy
      netbox-db:
        condition: service_started

Note: Before you paste the code above in the Web editor area below, change the value numbers for user with your own UID and GID values. The values are marked in 🟡 yellow in the code above. (Follow my step by step guide on how to do this.) 1026 is my personal UID value and 100 is my personal GID value. You have to type in your own values.
Note: Before you paste the code above in the Web editor area below, change the values numbers for PUID and PGID with your own PUID and GID values. The values are marked in 🟡 yellow in the code above. (Follow my step by step guide on how to do this.) 1026 is my personal PUID value and 100 is my personal PGID value. You have to type in your own values.
Note: Before you paste the code above in the Web editor area below, change the value for TZ. (Select your current Time Zone from this list.) The value is marked in 🔵 blue in the code above. Europe/Bucharest is my own Time Zone value. You have to type in your own Time Zone.
Note: Before you paste the code above in the Web editor area below, change the value for SUPERUSER_EMAIL. The value is marked in 🟠 orange in the code above. supergate84@gmail.com is my own email address. You have to type in your own email address.
Note: Before you paste the code above in the Web editor area below, change the value for SUPERUSER_PASSWORD. The value is marked in 🟠 orange in the code above. mariushosting is an example for a password. You have to type in your own password that you will need later at STEP 11.
Note: Before you paste the code above in the Web editor area below, change the value for ALLOWED_HOSTS and type in your own your own synology.me DDNS without https:// at the beginning that you have previously created at STEP 6.

NetBox Synology NAS Set up 3

  • STEP 7

Scroll down on the page until you see a button named Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.

NetBox Synology NAS Set up 4 new 2023

  • STEP 8

If everything goes right, you will see the following message at the top right of your screen: “Success Stack successfully deployed“.

NetBox Synology NAS Set up 5

  • STEP 9

Go back to STEP 1 or you will deal with karma 🙂

  • STEP 10

Please wait approximately 10 minutes for the installation to be completed or you will get a blank page if you try to connect too soon. Now open your browser and type in your HTTPS/SSL certificate like this https://netbox.yourname.synology.me that you have previously created at STEP 6. In my case it’s https://netbox.mariushosting.synology.me If everything goes right, you will see the Netbox main page. At the top right of the page click Log in. Follow the instructions in the image below.

Netbox Synology NAS Set up 6 new 2024

  • STEP 11

On the username area type in admin and in the password area type in the password that you have previously added at 🟠 STEP 13. Click Sign In. Follow the instructions in the image below.

Netbox Synology NAS Set up 7 new

Enjoy NetBox!

Netbox Synology NAS Set up 8 new 2024

🆘TROUBLESHOOTING

If you encounter issues by using this container, make sure to check out the Common Docker issues article.

Fix: If you get Bad Request (400) error message contact me to solve the issue.

Note: Can I run Docker on my Synology NAS? See the supported models.
Note: How to Back Up Docker Containers on your Synology NAS.
Note: Find out how to update the NetBox with the latest image.
NoteHow to Free Disk Space on Your NAS if You Run Docker.
NoteHow to Schedule Start & Stop For Docker Containers.
NoteHow to Activate Email Notifications.
NoteHow to Add Access Control Profile on Your NAS.
NoteHow to Change Docker Containers Restart Policy.
NoteHow to Use Docker Containers With VPN.
NoteConvert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.

This post was updated on Saturday / February 24th, 2024 at 5:52 AM