{"id":2898,"date":"2025-07-27T22:02:32","date_gmt":"2023-01-05T22:57:06","guid":{"rendered":""},"modified":"2025-02-02T00:46:19","modified_gmt":"2025-02-01T23:46:19","slug":"how-to-install-netbox-network-documentation-and-management-tool-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-netbox-network-documentation-and-management-tool-on-ubuntu-22-04\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 NetBox Network Documentation and Management Tool on Ubuntu 22.04"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p>NetBox is an open-source network documentation and management tool that allows users to manage IP addresses, devices, racks, and more. It is widely used for managing data center infrastructure and network automation. In this guide, we will walk through the steps to install NetBox on Ubuntu 22.04. Whether you\u2019re setting it up on a local server or deploying it on a , this guide will help you get NetBox up and running efficiently.<\/p>\n<section>\n<h2>Step 1: Update Your System<\/h2>\n<p>Before installing any new software, it\u2019s important to update your system. Run the following commands to ensure your Ubuntu 22.04 system is up to date:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade<\/code><\/pre>\n<p>This step ensures that your system has the latest software updates and security patches. Keeping your system updated is important whether you\u2019re hosting locally or on a <a href=\"https:\/\/ie.netcloud24.com\">UK Windows VPS<\/a>.<\/p>\n<\/section>\n<section>\n<h2>Step 2: Install Required Dependencies<\/h2>\n<p>NetBox requires several dependencies, including PostgreSQL, Redis, and Python packages. To install these dependencies, run the following command:<\/p>\n<pre><code>\r\nsudo apt install -y python3 python3-pip python3-venv libpq-dev postgresql postgresql-contrib redis-server nginx\r\n            <\/code><\/pre>\n<p>These dependencies are necessary to run NetBox, whether you\u2019re deploying it locally or on a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPSVirtual Private Server hosting<\/a> environment.<\/p>\n<\/section>\n<section>\n<h2>Step 3: Configure PostgreSQL<\/h2>\n<p>After installing PostgreSQL, you need to create a database and user for NetBox. Log in to the PostgreSQL shell with the following command:<\/p>\n<pre><code>sudo -u postgres psql<\/code><\/pre>\n<p>Create a new database and user for NetBox:<\/p>\n<pre><code>\r\nCREATE DATABASE netbox;\r\nCREATE USER netbox WITH PASSWORD 'yourpassword';\r\nALTER ROLE netbox SET client_encoding TO 'utf8';\r\nALTER ROLE netbox SET default_transaction_isolation TO 'read committed';\r\nALTER ROLE netbox SET timezone TO 'UTC';\r\nGRANT ALL PRIVILEGES ON DATABASE netbox TO netbox;\r\n\\q\r\n            <\/code><\/pre>\n<p>This creates a database and user for NetBox and assigns the necessary privileges. This setup will work whether you&#8217;re using a local server or deploying on a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS hosting UK<\/a>.<\/p>\n<\/section>\n<section>\n<h2>Step 4: Download and Set Up NetBox<\/h2>\n<p>Now, download the latest stable version of NetBox. Navigate to the <code>\/opt<\/code> directory:<\/p>\n<pre><code>cd \/opt<\/code><\/pre>\n<p>Clone the NetBox repository from GitHub:<\/p>\n<pre><code>sudo git clone -b master https:\/\/github.com\/netbox-community\/netbox.git<\/code><\/pre>\n<p>Once the repository is cloned, navigate into the NetBox directory:<\/p>\n<pre><code>cd netbox<\/code><\/pre>\n<p>Create a Python virtual environment for NetBox and activate it:<\/p>\n<pre><code>\r\nsudo python3 -m venv \/opt\/netbox\/venv\r\nsource \/opt\/netbox\/venv\/bin\/activate\r\n            <\/code><\/pre>\n<p>Install the required Python dependencies:<\/p>\n<pre><code>pip install -r requirements.txt<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 5: Configure NetBox<\/h2>\n<p>Copy the example configuration file and open it for editing:<\/p>\n<pre><code>\r\nsudo cp \/opt\/netbox\/netbox\/netbox\/configuration_example.py \/opt\/netbox\/netbox\/netbox\/configuration.py\r\nsudo nano \/opt\/netbox\/netbox\/netbox\/configuration.py\r\n            <\/code><\/pre>\n<p>Update the <code>ALLOWED_HOSTS<\/code> setting with your server\u2019s IP address or domain name:<\/p>\n<pre><code>ALLOWED_HOSTS = ['your-server-ip', 'your-domain.com']<\/code><\/pre>\n<p>Next, configure the database settings with the PostgreSQL credentials you created earlier:<\/p>\n<pre><code>\r\nDATABASE = {\r\n    'NAME': 'netbox',\r\n    'USER': 'netbox',\r\n    'PASSWORD': 'yourpassword',\r\n    'HOST': 'localhost',\r\n    'PORT': '',\r\n}\r\n            <\/code><\/pre>\n<p>Save and exit the file. This configuration works for both local and cloud-based environments such as <a href=\"https:\/\/ie.netcloud24.com\">Microsoft SQL VPS Windows<\/a>.<\/p>\n<\/section>\n<section>\n<h2>Step 6: Initialize NetBox<\/h2>\n<p>Run the following command to apply database migrations and create a superuser for NetBox:<\/p>\n<pre><code>\r\ncd \/opt\/netbox\/netbox\/\r\npython3 manage.py migrate\r\npython3 manage.py createsuperuser\r\npython3 manage.py collectstatic\r\n            <\/code><\/pre>\n<p>During the <code>createsuperuser<\/code> process, you will be prompted to enter a username, email, and password for the superuser account.<\/p>\n<\/section>\n<section>\n<h2>Step 7: Set Up Gunicorn and Nginx<\/h2>\n<p>To run NetBox in production, you\u2019ll need to configure Gunicorn and Nginx. Create a systemd service file for Gunicorn:<\/p>\n<pre><code>sudo nano \/etc\/systemd\/system\/netbox.service<\/code><\/pre>\n<p>Add the following configuration:<\/p>\n<pre><code>\r\n[Unit]\r\nDescription=NetBox WSGI Service\r\nAfter=network.target\r\n\r\n[Service]\r\nType=simple\r\nUser=root\r\nGroup=root\r\nWorkingDirectory=\/opt\/netbox\/netbox\/\r\nExecStart=\/opt\/netbox\/venv\/bin\/gunicorn --workers 3 --bind 0.0.0.0:8001 netbox.wsgi\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n            <\/code><\/pre>\n<p>Save the file, reload systemd, and start the NetBox service:<\/p>\n<pre><code>\r\nsudo systemctl daemon-reload\r\nsudo systemctl start netbox\r\nsudo systemctl enable netbox\r\n            <\/code><\/pre>\n<p>Now configure Nginx to act as a reverse proxy. Create a configuration file for NetBox:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/sites-available\/netbox<\/code><\/pre>\n<p>Add the following configuration:<\/p>\n<pre><code>\r\nserver {\r\n    listen 80;\r\n    server_name your-server-ip;\r\n\r\n    location \/ {\r\n        proxy_pass http:\/\/127.0.0.1:8001;\r\n        proxy_set_header Host $host;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header X-Forwarded-Proto $scheme;\r\n    }\r\n\r\n    location \/static\/ {\r\n        alias \/opt\/netbox\/netbox\/static\/;\r\n    }\r\n}\r\n            <\/code><\/pre>\n<p>Save the file, enable the site, and restart Nginx:<\/p>\n<pre><code>\r\nsudo ln -s \/etc\/nginx\/sites-available\/netbox \/etc\/nginx\/sites-enabled\/\r\nsudo systemctl restart nginx\r\n            <\/code><\/pre>\n<p>This setup is ideal for both local servers and hosting on a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS hosting UK<\/a> platform.<\/p>\n<\/section>\n<section>\n<h2>Step 8: Access NetBox<\/h2>\n<p>NetBox should now be accessible via your server\u2019s IP address or domain name. Open a browser and navigate to <code>http:\/\/your-server-ip\/<\/code> to access the NetBox login page. Log in using the superuser credentials you created earlier.<\/p>\n<\/section>\n<footer>\n<p>NetBox is now installed and running on your Ubuntu 22.04 server. This powerful network documentation and management tool is ready to help you manage your network infrastructure. For reliable and scalable hosting solutions, consider using . They offer a range of hosting plans, including <strong>windows virtual private servers<\/strong>, <strong>windows vps hosting<\/strong>, and <strong>windows virtual dedicated server hosting<\/strong>. Whether you need a <strong>windows vps italy<\/strong> or a <strong>uk vps windows<\/strong> solution, they provide the performance and flexibility needed to host your NetBox instance efficiently.<\/p>\n<\/footer>\n<\/article>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 NetBox is an open-source network documentation and management tool that allows users to manage IP addresses, devices, racks, and more. It is widely used for managing\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2898"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2898\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}