[{"data":1,"prerenderedAt":183},["ShallowReactive",2],{"seo-verification":3,"blog-self-host-netbox-vps-ipam-dcim-ma-en":6,"promo-bar-likely":182},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"key":7,"data":8},"blog-self-host-netbox-vps-ipam-dcim-ma-en",{"id":9,"slug":10,"slugs":11,"title":15,"excerpt":16,"readTime":17,"views":18,"isPinned":19,"noindex":19,"publishedAt":20,"updatedAt":21,"category":22,"categories":28,"featuredImage":30,"bgImage":31,"posterImage":32,"relatedSolution":33,"intro":36,"keyPoints":37,"sections":38,"ctaTitle":115,"ctaBody":116,"ctaButton":117,"ctaUrl":118,"relatedPosts":119},580,"self-host-netbox-vps-ipam-dcim",{"fr":12,"en":10,"ar":13,"es":14},"self-host-netbox-vps","استضافة-netbox-على-vps","autoalojar-netbox-vps-ipam-inventario-red","NetBox on a VPS: self-hosted IPAM and network inventory","Install NetBox on a VPS with Docker Compose: IPAM, racks and devices, REST API and v2 tokens, Ansible inventory, served over HTTPS behind nginx.",6,0,false,"2026-11-15T00:00:00+00:00","2026-11-15T06:54:22+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},7,"Self-hosting","self-hosting","bg-indigo-500\u002F10 text-indigo-400","cloud",[29],{"id":23,"name":24,"slug":25,"color":26,"icon":27},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fself-host-netbox-vps-poster.svg",{"categorySlug":34,"appSlug":35},"networking-vpn","netbox","The IP address spreadsheet always has one wrong line: an address assigned twice, a server retired but never removed, a VLAN nobody can explain anymore. NetBox replaces that file with a source of truth: every prefix, address, rack and cable is an object linked to the others, browsable in the web UI and driven by an API. This guide installs it on a VPS with Docker Compose, closes it to anonymous visitors, serves it over HTTPS behind nginx and connects it to your scripts and to Ansible.",[],[39,43,53,80,83,96,100,103,106,109,112],{"type":40,"title":41,"body":42},"h2","What NetBox does","NetBox documents a network and the infrastructure behind it. On the IPAM side it manages hierarchical prefixes, IP ranges and addresses, VLANs and VRFs, and calculates the free space of every network. On the DCIM side it describes sites, racks and their elevations, devices, their interfaces, cables and power. The two meet: an IP address belongs to a device interface, mounted in a rack at a site.\n\nThe project is released under the Apache-2.0 license. The official Docker stack, netbox-docker, relies on PostgreSQL and on Valkey (or Redis) for caching and the background task queue. On a VPS, the application and its worker use less than 1 GB of memory at rest.",{"type":44,"title":45,"items":46},"ul","What NetBox gives you",[47,48,49,50,51,52],"**A single source of truth** — the intended state of the network, instead of ten files that contradict each other.","**An IPAM that calculates** — free space per prefix, next available address, duplicate detection.","**A map of your racks** — every device in its place, with its ports and cables.","**An API for every object** — REST and GraphQL, with OpenAPI documentation served by the instance.","**A change log** — who changed what and when, with the before and after state.","**Automation** — webhooks, custom scripts, Ansible dynamic inventory.",{"type":54,"title":55,"headers":56,"rows":59},"comparison","Spreadsheet or NetBox on your VPS",[5,57,58],"Shared spreadsheet","NetBox on your VPS",[60,64,68,72,76],[61,62,63],"Address assigned twice","Nothing prevents it","Flagged on entry",[65,66,67],"Free space of a network","Counted again by hand","Calculated for every prefix",[69,70,71],"Link between address, device, rack","Copied columns","Linked objects",[73,74,75],"Change history","File versions","Per-object change log",[77,78,79],"Read by your scripts","CSV export","REST and GraphQL API",{"type":40,"title":81,"body":82},"Before you start","Plan an Ubuntu 24.04 VPS with at least 2 GB of RAM, 4 GB for a team, 2 vCPUs and 20 GB of disk, with Docker and the Compose plugin installed. You also need a hostname pointing to the VPS, for example `netbox.example.com`: NetBox only accepts forms, login included, from the origin declared in `CSRF_TRUSTED_ORIGINS`, and it will be served over HTTPS.",{"type":84,"title":85,"steps":86},"steps","Install NetBox with Docker Compose",[87,90,93],{"title":88,"body":89},"Prepare the folder and the .env file","This file holds the instance secrets. `SECRET_KEY` and `API_TOKEN_PEPPER_1` must be at least 50 characters long: the first signs sessions, the second is used to hash API tokens.\n```bash\nmkdir -p \u002Fopt\u002Fnetbox && cd \u002Fopt\u002Fnetbox\ncat > .env \u003C\u003CEOF\nDB_PASSWORD=$(openssl rand -hex 16)\nREDIS_PASSWORD=$(openssl rand -hex 16)\nSECRET_KEY=$(openssl rand -hex 32)\nAPI_TOKEN_PEPPER_1=$(openssl rand -hex 32)\nSUPERUSER_PASSWORD=$(openssl rand -hex 16)\nDOMAIN=netbox.example.com\nEOF\nchmod 600 .env\n```",{"title":91,"body":92},"Write the docker-compose.yml file","Four services: PostgreSQL, password-protected Valkey, NetBox and its background worker. The port is only published on the loopback interface: nginx alone will face the Internet.\n```yaml\nx-netbox: &netbox\n  image: netboxcommunity\u002Fnetbox:v4.7.5-5.1.2\n  restart: unless-stopped\n  user: \"netbox:root\"\n  environment: &netbox-env\n    DB_HOST: postgres\n    DB_NAME: netbox\n    DB_USER: netbox\n    DB_PASSWORD: \"${DB_PASSWORD}\"\n    REDIS_HOST: redis\n    REDIS_PASSWORD: \"${REDIS_PASSWORD}\"\n    REDIS_CACHE_HOST: redis\n    REDIS_CACHE_PASSWORD: \"${REDIS_PASSWORD}\"\n    REDIS_CACHE_DATABASE: \"1\"\n    SECRET_KEY: \"${SECRET_KEY}\"\n    API_TOKEN_PEPPER_1: \"${API_TOKEN_PEPPER_1}\"\n    SKIP_SUPERUSER: \"false\"\n    SUPERUSER_NAME: admin\n    SUPERUSER_PASSWORD: \"${SUPERUSER_PASSWORD}\"\n    LOGIN_REQUIRED: \"true\"\n    CSRF_TRUSTED_ORIGINS: \"https:\u002F\u002F${DOMAIN}\"\n  volumes:\n    - netbox-media:\u002Fopt\u002Fnetbox\u002Fnetbox\u002Fmedia\n\nservices:\n  postgres:\n    image: postgres:18.7-alpine\n    restart: unless-stopped\n    environment:\n      POSTGRES_DB: netbox\n      POSTGRES_USER: netbox\n      POSTGRES_PASSWORD: \"${DB_PASSWORD}\"\n    volumes:\n      - netbox-postgres:\u002Fvar\u002Flib\u002Fpostgresql\n\n  redis:\n    image: valkey\u002Fvalkey:9.1.3-alpine\n    restart: unless-stopped\n    command: [\"valkey-server\", \"--appendonly\", \"yes\", \"--requirepass\", \"${REDIS_PASSWORD}\"]\n    volumes:\n      - netbox-redis:\u002Fdata\n\n  netbox:\n    \u003C\u003C: *netbox\n    depends_on: [postgres, redis]\n    ports:\n      - \"127.0.0.1:8080:8080\"\n\n  netbox-worker:\n    \u003C\u003C: *netbox\n    depends_on: [netbox]\n    command: [\"\u002Fopt\u002Fnetbox\u002Fvenv\u002Fbin\u002Fpython\", \"\u002Fopt\u002Fnetbox\u002Fnetbox\u002Fmanage.py\", \"rqworker\"]\n\nvolumes:\n  netbox-postgres: {}\n  netbox-redis: {}\n  netbox-media: {}\n```",{"title":94,"body":95},"Start and check","The first start applies every database migration and creates the `admin` account: allow five to ten minutes on a small VPS. The login page must answer `200`, and the last command prints the administrator password.\n```bash\ndocker compose up -d\ndocker compose logs -f netbox    # wait for \"Initialisation is done\"\ncurl -s -o \u002Fdev\u002Fnull -w '%{http_code}\\n' http:\u002F\u002F127.0.0.1:8080\u002Flogin\u002F\ngrep SUPERUSER_PASSWORD .env\n```",{"type":97,"title":98,"body":99},"tip","Never change the two secrets afterwards","A new `SECRET_KEY` logs everyone out; a new `API_TOKEN_PEPPER_1` invalidates every API token already issued, and your scripts break at the same time. Back up the `.env` file along with the database. Likewise, `SUPERUSER_PASSWORD` is only used on first start: change the password from your profile afterwards.",{"type":40,"title":101,"body":102},"Serve NetBox over HTTPS behind nginx","NetBox listens in HTTP on `127.0.0.1:8080`; nginx terminates TLS and forwards requests to it. Keep `X-Forwarded-Proto` so the application knows it is served over HTTPS, and a `client_max_body_size` large enough for attachments and imports.\n```nginx\nserver {\n    listen 443 ssl;\n    server_name netbox.example.com;\n    ssl_certificate     \u002Fetc\u002Fletsencrypt\u002Flive\u002Fnetbox.example.com\u002Ffullchain.pem;\n    ssl_certificate_key \u002Fetc\u002Fletsencrypt\u002Flive\u002Fnetbox.example.com\u002Fprivkey.pem;\n    client_max_body_size 25m;\n\n    location \u002F {\n        proxy_pass http:\u002F\u002F127.0.0.1:8080;\n        proxy_set_header Host $host;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n    }\n}\n```\nIf the origin does not match `CSRF_TRUSTED_ORIGINS`, login fails with a 403 \"CSRF verification failed\" error: check the `https:\u002F\u002F` scheme and the exact hostname.",{"type":40,"title":104,"body":105},"First steps: site, prefixes and addresses","Log in at `https:\u002F\u002Fnetbox.example.com\u002Flogin\u002F` as `admin`. Start by creating a site, then the prefixes you use (IPAM, Prefixes): NetBox arranges them into a hierarchy automatically and shows how full each one is. Then add your devices (Devices), their interfaces and their IP addresses.\n\nTo bring in an existing spreadsheet, every list offers CSV or YAML import: paste the rows, NetBox validates every field and rejects the whole import if one line is wrong, which avoids half-finished migrations.",{"type":40,"title":107,"body":108},"Automate with the API and Ansible","Create a token from your profile, API Tokens menu. It goes in the `Authorization: Bearer` header, and the interactive documentation is served at `\u002Fapi\u002Fschema\u002Fswagger-ui\u002F`.\n```bash\nexport NETBOX_TOKEN='nbt_xxxxxxxx.yyyyyyyyyyyyyyyy'\ncurl -s -H \"Authorization: Bearer $NETBOX_TOKEN\" -H \"Accept: application\u002Fjson\" \\\n  \"https:\u002F\u002Fnetbox.example.com\u002Fapi\u002Fipam\u002Fprefixes\u002F?status=active\"\n\n# Reserve the next free address of a prefix (id 1) in one request\ncurl -s -X POST -H \"Authorization: Bearer $NETBOX_TOKEN\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"description\": \"web-01\"}' \\\n  \"https:\u002F\u002Fnetbox.example.com\u002Fapi\u002Fipam\u002Fprefixes\u002F1\u002Favailable-ips\u002F\"\n```\nOn the Ansible side, the `netbox.netbox` collection provides a dynamic inventory: your hosts and their groups come from NetBox, no more hand-maintained file. The token is passed in the `NETBOX_TOKEN` environment variable.\n```yaml\n# netbox_inventory.yml — ansible-galaxy collection install netbox.netbox\nplugin: netbox.netbox.nb_inventory\napi_endpoint: https:\u002F\u002Fnetbox.example.com\nvalidate_certs: true\ngroup_by: [sites, device_roles]\n```",{"type":40,"title":110,"body":111},"Back up and upgrade","Two things to back up: the PostgreSQL database and the attachments volume, plus the `.env` file.\n```bash\ncd \u002Fopt\u002Fnetbox\ndocker compose exec -T postgres pg_dump -U netbox netbox | gzip > netbox-$(date +%F).sql.gz\ndocker run --rm -v netbox_netbox-media:\u002Fmedia -v \"$PWD\":\u002Fbackup alpine \\\n  tar czf \u002Fbackup\u002Fnetbox-media-$(date +%F).tar.gz -C \u002Fmedia .\n```\nTo upgrade, change the image tag in `docker-compose.yml`, then run `docker compose pull` and `docker compose up -d`: migrations are applied on start. Read the release notes before changing major version, and take a backup right before.",{"type":40,"title":113,"body":114},"NetBox in one click on ServOrbit","The ServOrbit Marketplace installs exactly this stack: official netbox-docker image, PostgreSQL, Valkey and the worker, port published on `127.0.0.1` only, secrets generated, `admin` account created, login required and HTTPS configured on your domain or on the VPS's free subdomain. The administrator password is shown in your client area.","Your network source of truth on your VPS","A ServOrbit Ubuntu 24.04 VPS with 2 GB of RAM is enough to start with NetBox. One-click install from the Marketplace, HTTPS on your domain or on the VPS's free subdomain, administrator account created for you.","Install NetBox","\u002Fapplications\u002Fnetworking-vpn\u002Fnetbox",[120,140,163],{"id":121,"slug":122,"slugs":123,"title":127,"excerpt":128,"readTime":129,"views":130,"isPinned":19,"noindex":19,"publishedAt":131,"updatedAt":132,"category":133,"categories":137,"featuredImage":30,"bgImage":31,"posterImage":139,"relatedSolution":30},236,"automating-vps-server-management-with-ansible",{"fr":124,"en":122,"ar":125,"es":126},"ansible-automatiser-serveurs-vps","أتمتة-إدارة-خوادم-vps-باستخدام-ansible","automatizar-servidores-vps-con-ansible","Automating VPS Server Management with Ansible","Learn how to automate VPS fleet management with Ansible: inventory, playbooks, roles and Vault for a reproducible, auditable infrastructure.",10,2,"2026-08-08T00:00:00+00:00","2026-09-07T11:26:10+00:00",{"id":130,"name":134,"slug":135,"color":136,"icon":135},"Automation","automatisation","bg-brand-action\u002F10 text-brand-action",[138],{"id":130,"name":134,"slug":135,"color":136,"icon":135},"\u002Fblog\u002Fcovers\u002Fansible-automatiser-serveurs-vps-poster.svg",{"id":141,"slug":142,"slugs":143,"title":147,"excerpt":148,"readTime":149,"views":130,"isPinned":19,"noindex":19,"publishedAt":150,"updatedAt":151,"category":152,"categories":157,"featuredImage":30,"bgImage":31,"posterImage":159,"relatedSolution":160},361,"self-host-semaphore-ui-on-vps",{"fr":144,"en":142,"ar":145,"es":146},"self-host-semaphore-ui-vps","كيفية-استضافة-semaphore-ui-على-خادم-vps","como-alojar-semaphore-ui-en-un-vps","Self-host Semaphore UI on a VPS: Ansible Web Dashboard","Deploy Semaphore UI on a VPS: open-source web UI for Ansible, Terraform and OpenTofu — no CLI, embedded SQLite, no external database.",4,"2026-09-18T00:00:00+00:00","2026-11-04T16:30:27+00:00",{"id":153,"name":154,"slug":155,"color":156,"icon":155},3,"Deployment","deploiement","bg-success\u002F10 text-success",[158],{"id":153,"name":154,"slug":155,"color":156,"icon":155},"\u002Fblog\u002Fcovers\u002Fself-host-semaphore-ui-vps-poster.svg",{"categorySlug":161,"appSlug":162},"application-deployment-devops","semaphore",{"id":164,"slug":165,"slugs":166,"title":170,"excerpt":171,"readTime":17,"views":172,"isPinned":19,"noindex":19,"publishedAt":173,"updatedAt":174,"category":175,"categories":176,"featuredImage":30,"bgImage":31,"posterImage":178,"relatedSolution":179},572,"self-host-zabbix-vps-infrastructure-monitoring",{"fr":167,"en":165,"ar":168,"es":169},"self-host-zabbix-vps","استضافة-zabbix-على-vps-مراقبة-البنية-التحتية","autoalojar-zabbix-vps-monitorizacion-infraestructura","Zabbix on a VPS: Monitor Servers, Services and Network","Install Zabbix on a VPS with Docker Compose: server, SNMP network and website monitoring, triggers and alerts, behind nginx over HTTPS.",1,"2026-11-09T00:00:00+00:00","2026-11-09T20:55:08+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[177],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fself-host-zabbix-vps-poster.svg",{"categorySlug":180,"appSlug":181},"monitoring-observability","zabbix",true,1794785353029]