| 71 | === Download NetBox === |
| 72 | This documentation provides two options for installing NetBox: from a downloadable archive, or from the git repository. Installing from a package (option A below) requires manually fetching and extracting the archive for every future update, whereas installation via git (option B) allows for seamless upgrades by re-pulling the master branch. |
| 73 | |
| 74 | === Option A: Download a Release Archive === |
| 75 | Download the latest stable release from GitHub as a tarball or ZIP archive and extract it to your desired path. In this example, we'll use ''' /opt/netbox ''' as the NetBox root. |
| 76 | {{{ |
| 77 | # sudo wget https://github.com/netbox-community/netbox/archive/vX.Y.Z.tar.gz |
| 78 | # sudo tar -xzf vX.Y.Z.tar.gz -C /opt |
| 79 | # sudo ln -s /opt/netbox-X.Y.Z/ /opt/netbox |
| 80 | }}} |
| 81 | |
| 82 | === Option B: Clone the Git Repository === |
| 83 | Create the base directory for the NetBox installation. For this guide, we'll use ''' /opt/netbox. ''' |
| 84 | {{{ |
| 85 | # sudo mkdir -p /opt/netbox/ |
| 86 | # cd /opt/netbox/ |
| 87 | }}} |
| 88 | if ''' git ''' is not already installed, install it: |
| 89 | {{{ |
| 90 | # sudo apt install -y git |
| 91 | }}} |
| 92 | Next, clone the master branch of the NetBox GitHub repository into the current directory. (This branch always holds the current stable release.) |
| 93 | {{{ |
| 94 | sudo git clone -b master --depth 1 https://github.com/netbox-community/netbox.git . |
| 95 | }}} |
| 96 | The git clone command should generate output similar to the following: |
| 97 | {{{ |
| 98 | Cloning into '.'... |
| 99 | remote: Enumerating objects: 996, done. |
| 100 | remote: Counting objects: 100% (996/996), done. |
| 101 | remote: Compressing objects: 100% (935/935), done. |
| 102 | remote: Total 996 (delta 148), reused 386 (delta 34), pack-reused 0 |
| 103 | Receiving objects: 100% (996/996), 4.26 MiB | 9.81 MiB/s, done. |
| 104 | Resolving deltas: 100% (148/148), done. |
| 105 | }}} |
| 106 | |
| 107 | === Create the NetBox System User === |
| 108 | Create a system user account named ''' netbox '''. We'll configure the WSGI and HTTP services to run under this account. We'll also assign this user ownership of the media directory. This ensures that NetBox will be able to save uploaded files. |