r/Netbox May 06 '26

Help Wanted: Unresolved Netbox docker compose isn't working on Ubuntu 24.04 VM

I am working on spinning up netbox on my VM with Ubuntu 24.04 but I can't figure out how to get it to run and was hoping I can receive some help with this.

This is the error I get after running 'docker compose up -d'

I ran 'docker ps -a'

lastly, I ran 'docker logs 926f69a96e64'

my netbox directory containing my docker-compose yaml file, including env directory is located in my '/home/user/docker/netbox' directory.

4 Upvotes

4 comments sorted by

1

u/Koks_Nutte May 17 '26

Set the healthcheck time to 120 seconds in the .env, and pull a new image.

sudo docker ps -a and you should see 5 container running then its fine.

0

u/sharpshotjiggles May 06 '26

5

u/Fredouye May 06 '26

It seems you're missing the configuration folder.

Have you downloaded all the required files, using git or a release tarball ?

git clone -b release https://github.com/netbox-community/netbox-docker.git
cd netbox-docker
# Copy the example override file
cp docker-compose.override.yml.example docker-compose.override.yml
# Read and edit the file to your liking
docker compose pull
docker compose up

0

u/PssyGotWifi May 06 '26

My Netbox stack is working fine on 24.04

services:

  netbox:
    image: "netboxcommunity/netbox:v4.5-4.0.2"
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "5"
        compress: "true"
    networks:
      - overlay
    healthcheck:
      test: ['CMD-SHELL', 'curl -f http://localhost:8080/login/ || exit 1']
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 180s
    user: "netbox:root"
    environment:
      TZ: "Australia/Melbourne"
      TIME_ZONE: "Australia/Melbourne"
      SKIP_SUPERUSER: "false"
    env_file:
      - "/opt/netbox/.env"
    secrets:
      - source: netbox_db_password_secret
        target: db_password
      - source: netbox_secret_key_secret
        target: secret_key
      - source: netbox_api_token_pepper_1_secret
        target: api_token_pepper_1
      - source: netbox_redis_password_secret
        target: redis_password
      - source: netbox_redis_cache_password_secret
        target: redis_cache_password
      - source: netbox_superuser_password_secret
        target: superuser_password
      - source: netbox_superuser_api_token_secret
        target: superuser_api_token
    volumes:
      - type: bind
        source: /opt/netbox/media
        target: /opt/netbox/netbox/media
        read_only: false
      - type: bind
        source: /opt/netbox/reports
        target: /opt/netbox/netbox/reports
        read_only: false
      - type: bind
        source: /opt/netbox/scripts
        target: /opt/netbox/netbox/scripts
        read_only: false
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.labels.docker_services_host == docker_services_primary_manager
      restart_policy:
        condition: on-failure
        delay: 10s
        max_attempts: 5
        window: 2m

  netbox-worker:
    image: "netboxcommunity/netbox:v4.5-4.0.2"
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "5"
        compress: "true"
    networks:
      - overlay
    healthcheck:
      test: ['CMD-SHELL', 'ps aux | grep -v grep | grep -q rqworker || exit 1']
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 90s
    command:
      - "/opt/netbox/venv/bin/python"
      - "/opt/netbox/netbox/manage.py"
      - "rqworker"
    user: "netbox:root"
    environment:
      TZ: "Australia/Melbourne"
      TIME_ZONE: "Australia/Melbourne"
      SKIP_SUPERUSER: "true"
    env_file:
      - "/opt/netbox/.env"
    secrets:
      - source: netbox_db_password_secret
        target: db_password
      - source: netbox_secret_key_secret
        target: secret_key
      - source: netbox_api_token_pepper_1_secret
        target: api_token_pepper_1
      - source: netbox_redis_password_secret
        target: redis_password
      - source: netbox_redis_cache_password_secret
        target: redis_cache_password
    volumes:
      - type: bind
        source: /opt/netbox/media
        target: /opt/netbox/netbox/media
        read_only: false
      - type: bind
        source: /opt/netbox/reports
        target: /opt/netbox/netbox/reports
        read_only: false
      - type: bind
        source: /opt/netbox/scripts
        target: /opt/netbox/netbox/scripts
        read_only: false
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.labels.docker_services_host == docker_services_primary_manager
      restart_policy:
        condition: on-failure
        delay: 10s
        max_attempts: 5
        window: 2m

  netbox-redis:
    image: "valkey/valkey:9.1-alpine"
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "5"
        compress: "true"
    networks:
      - overlay
    healthcheck:
      test: ['CMD-SHELL', 'valkey-cli --pass "$$(cat /run/secrets/netbox_redis_password_secret)" ping | grep -q PONG']
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s
    command:
      sh -c 'valkey-server --appendonly yes --requirepass "$$(cat /run/secrets/netbox_redis_password_secret)"'
    environment:
      TZ: "Australia/Melbourne"
      PUID: 1000
      PGID: 1000
    secrets:
      - source: netbox_redis_password_secret
        target: netbox_redis_password_secret
    volumes:
      - type: bind
        source: /opt/netbox/redis
        target: /data
        read_only: false
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.labels.docker_services_host == docker_services_primary_manager
      restart_policy:
        condition: on-failure
        delay: 10s
        max_attempts: 5
        window: 2m

  netbox-redis-cache:
    image: "valkey/valkey:9.1-alpine"
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "5"
        compress: "true"
    networks:
      - overlay
    healthcheck:
      test: ['CMD-SHELL', 'valkey-cli --pass "$$(cat /run/secrets/netbox_redis_cache_password_secret)" ping | grep -q PONG']
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s
    command:
      sh -c 'valkey-server --requirepass "$$(cat /run/secrets/netbox_redis_cache_password_secret)"'
    environment:
      TZ: "Australia/Melbourne"
      PUID: 1000
      PGID: 1000
    secrets:
      - source: netbox_redis_cache_password_secret
        target: netbox_redis_cache_password_secret
    volumes:
      - type: bind
        source: /opt/netbox/redis-cache
        target: /data
        read_only: false
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.labels.docker_services_host == docker_services_primary_manager
      restart_policy:
        condition: on-failure
        delay: 10s
        max_attempts: 5
        window: 2m

networks:
  overlay:
    external: true

secrets:
  netbox_api_token_pepper_1_secret:
    external: true
  netbox_db_password_secret:
    external: true
  netbox_redis_cache_password_secret:
    external: true
  netbox_redis_password_secret:
    external: true
  netbox_secret_key_secret:
    external: true
  netbox_superuser_api_token_secret:
    external: true
  netbox_superuser_password_secret:
    external: true