How to upgrade agent (systemd) - SaaShup/netbox-docker-agent GitHub Wiki

It is possible to upgrade your agent from netbox with the following setup.

Use systemd with a similar configuration :

        [Unit]
        Description=Netbox Docker Agent
        After=docker.service
        Requires=docker.service
        [Service]
        TimeoutStartSec=0
        ExecStartPre=-/usr/bin/docker pull saashup/netbox-docker-agent
        ExecStartPre=-/usr/bin/docker rm --force netbox-docker-agent
        ExecStart=/usr/bin/docker run -p 1880:1880 -e ENABLE_EDITOR=1 -v /var/run/docker.sock:/var/run/docker.sock:rw -v netbox-docker-agent:/data --name netbox-docker-agent saashup/netbox-docker-agent
        ExecStop=/usr/bin/docker stop netbox-docker-agent
        Restart=always
        RestartSec=5s
        [Install]
        WantedBy=multi-user.target

If you run the netbox-docker-agent with this configuration you can then connect to your netbox to upgrade.

Go on the host you want to upgrade and check version and status :

Screenshot from 2025-05-28 11-26-31

Then select the netbox-docker-agent container on this host :

Screenshot from 2025-05-28 11-27-03

Click on the stop Button : Screenshot from 2025-05-28 14-05-33

By stopping the container systemd will detect it and launch the pull / delete and create of the netbox-docker-agent container.

Going back on the Host you will see a new netbox-docker-agent container. Select it and check the status :

Screenshot from 2025-05-28 11-28-01

Going back on the host page you will see the new version of the host agent :

Screenshot from 2025-05-28 11-28-42

Voila! Your agent is up to date.