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.3.9 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

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 4

Now create three new folders inside the netbox folder that you created at STEP 3 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 5

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 6

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: linuxserver/netbox:latest
    container_name: NETBOX
    hostname: netbox
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://192.168.1.18:9458/ || exit 1
    environment:
      - PUID=1026
      - PGID=100
      - TZ=Europe/Bucharest
      - SUPERUSER_EMAIL=supergate84@gmail.com
      - SUPERUSER_PASSWORD=mariushosting
      - ALLOWED_HOST=192.168.1.18
      - 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:
      - 192.168.1.18:9458:8000
    restart: always
    depends_on:
      netbox-redis:
        condition: service_healthy
      netbox-db:
        condition: service_healthy

🟡 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 IP in the code with your local NAS IP. The values are marked in 🟢 green in the code above. 192.168.1.18 is my personal NAS local IP. You have to type in your own local NAS IP.
🔵 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 🟣 purple 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.

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

  • 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 http://Synology-ip-address:9458 Click Log In. Follow the instructions in the image below.

NetBox Synology NAS Set up 6

  • STEP 11

On the username area type in admin and in the password area type in the password you have chosen at 🟣 STEP 6. Click Sign In. Follow the instructions in the image below.

NetBox Synology NAS Set up 7

Enjoy NetBox!

NetBox Synology NAS Set up 8

Note: Can I run Docker on my Synology NAS? See the supported models.
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.

This post was updated on Thursday / December 1st, 2022 at 6:34 AM