{"id":74,"date":"2025-05-22T23:45:07","date_gmt":"2025-05-22T21:45:07","guid":{"rendered":"https:\/\/netcloud24.com\/pl\/blog\/?p=74"},"modified":"2025-05-22T23:45:07","modified_gmt":"2025-05-22T21:45:07","slug":"jak-zainstalowac-netbox-irm-na-ubuntu-24-04-server","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/pl\/blog\/jak-zainstalowac-netbox-irm-na-ubuntu-24-04-server\/","title":{"rendered":"Jak zainstalowa\u0107 NetBox IRM na Ubuntu 24.04 Server\u00a0"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>NetBox IRM (Infrastructure Resource Modeling) to otwarto\u017ar\u00f3d\u0142owe narz\u0119dzie do dokumentacji i zarz\u0105dzania zasobami sieciowymi, serwerami, centr\u00f3w danych i ca\u0142\u0105 infrastruktur\u0105 IT. Dzi\u0119ki NetBox mo\u017cesz sp\u00f3jnie modelowa\u0107 adresacj\u0119 IP, szafy rack, urz\u0105dzenia, po\u0142\u0105czenia i wiele innych element\u00f3w infrastruktury.<\/p>\n<h2>Wymagania wst\u0119pne<\/h2>\n<ul>\n<li>Serwer z systemem Ubuntu 24.04<\/li>\n<li>Konto z uprawnieniami root lub dost\u0119p do <code>sudo<\/code><\/li>\n<li>Minimum 2 GB RAM (wi\u0119cej przy du\u017cych \u015brodowiskach)<\/li>\n<li>Po\u0142\u0105czenie z internetem do pobrania pakiet\u00f3w<\/li>\n<\/ul>\n<h2>Krok 1: Aktualizacja systemu<\/h2>\n<pre><code>sudo apt update\r\nsudo apt upgrade -y\r\n<\/code><\/pre>\n<h2>Krok 2: Instalacja zale\u017cno\u015bci<\/h2>\n<p>NetBox wymaga Pythona, PostgreSQL, Redis oraz kilku bibliotek systemowych:<\/p>\n<pre><code>sudo apt install -y python3 python3-venv python3-pip \\\r\n    libpq-dev gcc git redis nginx \\\r\n    postgresql postgresql-contrib\r\n<\/code><\/pre>\n<h2>Krok 3: Konfiguracja PostgreSQL<\/h2>\n<pre><code>sudo -u postgres psql\r\nCREATE DATABASE netbox;\r\nCREATE USER netbox WITH PASSWORD 'TwojeHasloNetbox';\r\nGRANT ALL PRIVILEGES ON DATABASE netbox TO netbox;\r\n\\q\r\n<\/code><\/pre>\n<h2>Krok 4: Pobranie kodu NetBox<\/h2>\n<p>Przejd\u017a do katalogu aplikacji i pobierz repozytorium:<\/p>\n<pre><code>cd \/opt\r\nsudo git clone -b master https:\/\/github.com\/netbox-community\/netbox.git netbox\r\ncd netbox\r\n<\/code><\/pre>\n<h2>Krok 5: Utworzenie wirtualnego \u015brodowiska i instalacja Pythona<\/h2>\n<pre><code>sudo python3 -m venv venv\r\nsudo chown -R $USER:$USER .\r\nsource venv\/bin\/activate\r\npip install --upgrade pip setuptools wheel\r\npip install -r requirements.txt\r\ndeactivate\r\n<\/code><\/pre>\n<h2>Krok 6: Konfiguracja NetBox<\/h2>\n<p>Skopiuj i edytuj plik konfiguracyjny:<\/p>\n<pre><code>cp netbox\/netbox\/configuration_example.py netbox\/netbox\/configuration.py\r\nnano netbox\/netbox\/configuration.py\r\n<\/code><\/pre>\n<p>Ustaw parametry bazy danych, klucz tajny oraz ustawienia Redis:<\/p>\n<ul>\n<li><code>DB_NAME = 'netbox'<\/code><\/li>\n<li><code>DB_USER = 'netbox'<\/code><\/li>\n<li><code>DB_PASSWORD = 'TwojeHasloNetbox'<\/code><\/li>\n<li><code>REDIS_HOST = 'localhost'<\/code><\/li>\n<\/ul>\n<h2>Krok 7: Inicjalizacja bazy danych i tworzenie konta administratora<\/h2>\n<pre><code>source venv\/bin\/activate\r\ncd netbox\r\npython3 manage.py migrate\r\npython3 manage.py createsuperuser\r\npython3 manage.py collectstatic --no-input\r\ndeactivate\r\n<\/code><\/pre>\n<h2>Krok 8: Konfiguracja Gunicorn i systemd<\/h2>\n<p>Utw\u00f3rz us\u0142ug\u0119 systemd <code>\/etc\/systemd\/system\/netbox.service<\/code>:<\/p>\n<pre><code>[Unit]\r\nDescription=Gunicorn instance for NetBox\r\nAfter=network.target\r\n\r\n[Service]\r\nUser=root\r\nGroup=www-data\r\nWorkingDirectory=\/opt\/netbox\/netbox\r\nEnvironment=\"PATH=\/opt\/netbox\/venv\/bin\"\r\nExecStart=\/opt\/netbox\/venv\/bin\/gunicorn --workers 3 \\\r\n  --bind unix:\/run\/netbox.sock netbox.wsgi\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/code><\/pre>\n<pre><code>sudo systemctl daemon-reload\r\nsudo systemctl enable netbox\r\nsudo systemctl start netbox\r\n<\/code><\/pre>\n<h2>Krok 9: Konfiguracja Nginx<\/h2>\n<p>Utw\u00f3rz plik <code>\/etc\/nginx\/sites-available\/netbox<\/code>:<\/p>\n<pre><code>server {\r\n    listen 80;\r\n    server_name twojadomena.pl;\r\n\r\n    client_max_body_size 25m;\r\n\r\n    location \/static\/ {\r\n        alias \/opt\/netbox\/netbox\/static\/;\r\n    }\r\n\r\n    location \/ {\r\n        proxy_pass http:\/\/unix:\/run\/netbox.sock;\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    }\r\n}\r\n<\/code><\/pre>\n<pre><code>sudo ln -s \/etc\/nginx\/sites-available\/netbox \/etc\/nginx\/sites-enabled\/\r\nsudo nginx -t\r\nsudo systemctl reload nginx\r\n<\/code><\/pre>\n<h2>Dlaczego warto wybra\u0107 VPS Windows lub serwer dedykowany z Netcloud24?<\/h2>\n<p>Dla stabilnej i wydajnej pracy NetBox IRM rekomendujemy profesjonalne rozwi\u0105zania hostingowe od <a href=\"https:\/\/netcloud24.com\/\" target=\"_blank\" rel=\"noopener\"><strong>Netcloud24<\/strong><\/a>:<\/p>\n<ul>\n<li><strong>VPS Windows<\/strong> z dedykowanymi zasobami CPU\/RAM<\/li>\n<li><strong>Serwery dedykowane<\/strong> ze szybkimi dyskami SSD<\/li>\n<li>Mo\u017cliwo\u015b\u0107 elastycznego skalowania infrastruktury<\/li>\n<li>Wsparcie techniczne 24\/7 i wysoka dost\u0119pno\u015b\u0107<\/li>\n<\/ul>\n<h2>Podsumowanie<\/h2>\n<p>NetBox IRM to pot\u0119\u017cne narz\u0119dzie do dokumentacji i modelowania zasob\u00f3w infrastruktury. Dzi\u0119ki temu przewodnikowi szybko uruchomisz w\u0142asn\u0105 instancj\u0119 na Ubuntu 24.04, a niezawodne serwery z Netcloud24 zapewni\u0105 jej stabilne dzia\u0142anie.<\/p>\n<p>Sprawd\u017a ofert\u0119 serwer\u00f3w: <a href=\"https:\/\/netcloud24.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/netcloud24.com\/<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; NetBox IRM (Infrastructure Resource Modeling) to otwarto\u017ar\u00f3d\u0142owe narz\u0119dzie do dokumentacji i zarz\u0105dzania zasobami sieciowymi, serwerami, centr\u00f3w danych i ca\u0142\u0105 infrastruktur\u0105 IT. Dzi\u0119ki NetBox mo\u017cesz\u2026<\/p>\n","protected":false},"author":1,"featured_media":75,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-74","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":1,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/posts\/74\/revisions\/76"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/media\/75"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/pl\/blog\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}