Netbox IPAM DCIM

Docker install seems working:

Netbox-docker install

# install requirements
yum -y install git nethserver-docker

# enable portainer
config setprop portainer status enabled
signal-event nethserver-docker-update

# get docker-compose and set permissions
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

# get the docker environment
git clone -b release https://github.com/netbox-community/netbox-docker.git
cd netbox-docker

# write the docker compose config
tee docker-compose.override.yml <<EOF
version: '3.4'
services:
  netbox:
    ports:
      - 8000:8080
EOF

# get and start containers
docker-compose pull
docker-compose up -d

Use portainer to join container “netbox-docker_netbox_1” to the aqua network.

You may open port 8000 by creating a service and browse to http://<NethServer>:8000 or use a name reverse proxy to http://localhost:8000 and login with user admin and password admin

To open port 8000 you may use command line or the web UI.

config setprop netbox status enabled TCPPort 8000 access green,red
signal-event firewall-adjust

Update netbox

cd ~/netbox-docker
docker-compose down
git checkout release && git pull -p origin release
signal-event nethserver-docker-update
docker-compose up -d

Configure netbox to autostart and use aqua network

Edit ~/netbox-docker/docker-compose.override.yml to look like this:

version: '3.4'
services:
  netbox:
    ports:
      - 8000:8080
    restart: unless-stopped
  netbox-worker:
    restart: unless-stopped
  netbox-housekeeping:
    restart: unless-stopped
  postgres:
    restart: unless-stopped
  redis:
    restart: unless-stopped
  redis-cache:
    restart: unless-stopped

networks:
  default:
    external: true
    name: aqua
1 Like

Good morning, great news! :+1: - will test the steps later…

As a 2nd step I would need to install ansible, how can I connect to the docker machine and install it?

Ansible should use the data from Netbox (API)…

Got a permission problem:


Fixed it with chmod…

1 Like

Thanks, I forgot to write it down, I corrected my post

No Problem…

Now I am here:

I think this is ok but I cant do the next step:

I try to do this:

Maybe I have to setup the firewall rules, trusted network… because I do it via VPN?

You need to signal-event nethserver-docker-update after config setprop portainer status enabled to make portainer available, I corrected my post again :innocent:

Then login to portainer and join the network there.

In Containers click on nethbox-docker_netbox1

Scroll down to the network settings and choose aqua and “Join network”

1 Like

Sorry, cant see any container:

Just click once on primary endpoint…

OK, did it :grinning_face_with_smiling_eyes: - Tried to do the last step:

Open Port 8000 by creating a service?

this is fantastic news. Finally removing the need and dependency of operating many servers, and different variations of servers.

A quick question on Docker.

Does it mean that any software on the internet that has support for docker and has docker install instructions can be installed on Nethserver using the Docker portainer module?

do they include ones with docker image too?

Create a service in cockpit:

Add name, port and access

This process opens port 8000 for red and green.

Maybe like this:
config setprop netbox status enabled TCPPort 8000 access green,red
config set netbox service status enabled

1 Like

Yes, this is the same process on command line.

These two lines should be enough:

config setprop netbox status enabled TCPPort 8000 access green,red
signal-event firewall-adjust

Yes. basically that should work. You need to check for port conflicts, some docker installations assume your local ports 80 and 443 are unused so you need to change ports for example.

Sorry, I don’t understand…

EDIT:

Yes, docker images are supported.

1 Like

would another mail software running inside docker on Nethserver that has nethserver-mail enabled produce conflict, or it will work just as fine.

In this case i am referring to something like mailcow.email | The mailserver suite with the ‘moo’ – :cow: + :whale2: = :two_hearts:

Didnt get a response and tried to create a service with:

Now I am here:

It’s a challenge because the default mailports are in use locally by nethserver-mail, so you need to use other ports or don’t use local dockerproxy port bindings at all and talk to the container directly (by using aeria or macvlan network)…

No, that’s not the right way, you created a service, we only need a network service, see docs.

OK, sorry…

No problem. I used the reverse proxy way and I think shorewall still blocks access to port 8000…I need to check…

For quick testing you may disable shorewall firewall with

shorewall clear

and browse to

http://<nethserver>:8000

To reenable the firewall use

signal-event firewall-adjust