Skip to content

Instantly share code, notes, and snippets.

@9to1url
Last active April 4, 2022 05:56
Show Gist options
  • Save 9to1url/3226825588b3b5550ecad08c367c48a7 to your computer and use it in GitHub Desktop.
Save 9to1url/3226825588b3b5550ecad08c367c48a7 to your computer and use it in GitHub Desktop.
How to build NetMaker from source after running NetMaker from Docker

For this setup, I use three VMs, one for server , two for clients

  • follow the steps Quick Install to run the Quick Install(docker version)

  • docker compose down the quick install servers

    • docker-compose down
  • Fork NetMaker and NetMaker-UI

  • create ssh key on server

    • ssh-keygen -t ed25519
  • Clone both repos on server VM

  • install golang

    • sudo add-apt-repository ppa:longsleep/golang-backports
    • sudo apt update
    • sudo apt install golang-go
  • install JS env

    • apt install nodejs
    • apt install npm
    • sudo npm install -g n
    • sudo mkdir -p /usr/local/n
    • sudo chown -R $(whoami) /usr/local/n
    • sudo mkdir -p /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share
    • sudo chown -R $(whoami) /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share
    • n lts
  • install and setup sqlite(might not need) on server VM

    • apt install sqlite
  • apt install caddy on server VM

  • apt install mosquitto on server VM

    • apt install mosquitto
  • check docker compose file to extract data and setup in each server

  • configure caddy

    • change the content in Caddy file from quick install and replace the /etc/caddy/Caddyfile
  • configure mosquitto

  • configure sqlite

  • build and copy netclient to client VM

    • cd NetMaker Repo
    • go build
    • cd netclient
    • go build
  • run netmaker server

    • create .env file with all the env vars in docker-compose with : export NAME="value"
    • post my sanitized one here :-)
#!/bin/sh


export      SERVER_HOST="10.172.192.99"
export      SERVER_API_CONN_STRING="api.netmaker.10-172-192-99.nip.io:443"
export      SERVER_GRPC_CONN_STRING="grpc.netmaker.10-172-192-99.nip.io:443"
export      COREDNS_ADDR="10.172.192.99"
export      GRPC_SSL="on"
export      DNS_MODE="on"
export      SERVER_HTTP_HOST="api.netmaker.10-172-192-99.nip.io"
export      SERVER_GRPC_HOST="grpc.netmaker.10-172-192-99.nip.io"
export      API_PORT="8081"
export      GRPC_PORT="50051"
export      CLIENT_MODE="on"
export      MASTER_KEY="e0V************************************BM"
export      CORS_ALLOWED_ORIGIN="*"
export      DISPLAY_KEYS="on"
export      DATABASE="sqlite"
export      NODE_ID="netmaker-server-1"
export      MQ_HOST="mq"
export      HOST_NETWORK="off"
export      MANAGE_IPTABLES="on"
export      PORT_FORWARD_SERVICES="mq"
export      VERBOSITY="1"
  • source .env
  • sudo ./netmaker
  • run netmake-ui server
    • create .env file add export PORT=8082
#!/bin/sh

export BACKEND_URL="https://api.netmaker.10-172-192-99.nip.io"
export PORT=8082
  • npm i
  • npm start
  • follow previous steps to run netclients
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment