Created Getting Started (markdown)

Christian Mäder 2019-11-20 11:07:20 +01:00
parent c5980d8ec3
commit 256db8721a

99
Getting-Started.md Normal file

@ -0,0 +1,99 @@
# Getting Started with Netbox Docker
This is a basic introduction on how to get started using Netbox with Docker on your local machine.
## Requirements
It is required that you have a recent installation of _Docker Community Edition_ (or compatible) and _docker-compose_.
(The current minimal requirements are defined [in our `README.md`][dependencies]).
You also need to have [`Git` installed][git].
And finally you should be working on a BSD or Linux kernel.
Netbox Docker should basically also work on _Docker for Windows_ (with Linux backend) or _Windows Subsystem for Linux (WSL)_, but this guide does not cover this (yet).
[dependencies]: https://github.com/netbox-community/netbox-docker#dependencies
[git]: https://git-scm.com/downloads
## Quick-Start
The first step is to clone [the `netbox-docker` repository][netbox-docker] to your computer.
For that, open a terminal (e.g. _Terminal_ on _macOS_ or _xterm_ on _Linux_).
1. First you should navigate to the directory where you would like to clone the project to, e.g. `~/projects/`.
2. Second have to clone the project.
3. Then you should change to the new directory.
```bash
# (1)
mkdir -p ~/projects && cd projects
# (2)
git clone -b master https://github.com/netbox-community/netbox-docker.git
# (3)
cd netbox-docker
```
Now you need to create a new file which defines the port under which Netbox will be available.
The file's name must be `docker-compose.override.yml` and it's content should be as follows:
```yaml
version: '3.4'
services:
nginx:
ports:
- 6000:8080
```
This file will define that Netbox Docker will always listen on port `6000` when it starts up.
(Without that file it would listen on a random port so that you can start multiple Netbox instances in parallel.)
If you already have something listening on port `6000` feel free to change it.
To get Netbox Docker up-and-running, here are the two final steps:
4. You will need to pull all the containers from the Docker registry.
This may take a while, depending on your internet connection.
5. Finally you can start all the required Docker containers.
```bash
# (4)
docker-compose pull
# (5)
docker-compose up
```
You will see a lot of output on your screen.
Netbox will be initialising the database and then start.
The whole application will be available after a few minutes.
Copy the URL `http://0.0.0.0:6000/` in a web-browser.
You should see the Netbox homepage.
On the top-right corner you can log-in.
The default credentials are:
* Username: **admin**
* Password: **admin**
* API Token: **0123456789abcdef0123456789abcdef01234567**
[netbox-docker]: https://github.com/netbox-community/netbox-docker
[docker-reception]: https://github.com/nxt-engineering/reception
## Shutdown
If you want to just stop Netbox to continue work later on, use the following command.
```bash
# Stop all the containers
docker-compose stop
# Start the containers again
docker-compose up
```
If you want to stop Netbox and clean up any resources it allocated (database, files, etc.), use the following command. **Attention:** It will remove any data you have entered in Netbox!
```bash
docker-compose down -v
```