server installation section completed

This commit is contained in:
afeiszli 2021-05-18 13:55:06 -04:00
parent 22c3bbdb48
commit 2e2a516caa
23 changed files with 1448 additions and 132 deletions

View file

@ -1,5 +1,8 @@
version: "3.4"
volumes:
dnsconfig:
driver: local
services:
mongodb:
image: mongo:4.2
@ -7,33 +10,22 @@ services:
- "27017:27017"
container_name: mongodb
volumes:
- /netmaker/mongodb:/data/db
- mongovol:/data/db
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: mongoadmin
MONGO_INITDB_ROOT_PASSWORD: mongopass
netmaker:
privileged: true
container_name: netmaker
ports:
- "8081:8081"
- "50051:50051"
depends_on:
- mongodb
image: gravitl/netmaker:v0.3
volumes:
- ./:/local
- /etc/netclient:/etc/netclient
- /netmaker/coredns:/root/config/dnsconfig
- /usr/bin/wg:/usr/bin/wg
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
- /run/systemd/system:/run/systemd/system
- /etc/systemd/system:/etc/systemd/system
- /sys/fs/cgroup:/sys/fs/cgroup
cap_add:
- NET_ADMIN
- SYS_MODULE
restart: always
network_mode: host
environment:
SERVER_GRPC_HOST: "192.168.88.101"
SERVER_HOST: "HOST_IP"
CLIENT_MODE: "off"
netmaker-ui:
container_name: netmaker-ui
@ -45,4 +37,18 @@ services:
ports:
- "80:80"
environment:
BACKEND_URL: "http://64.147.211.252:8081"
BACKEND_URL: "http://HOST_IP:8081"
coredns:
depends_on:
- netmaker
image: coredns/coredns
command: -conf /root/dnsconfig/Corefile
container_name: coredns
restart: always
ports:
- "53:53/udp"
volumes:
- dnsconfig:/root/dnsconfig
volumes:
mongovol: {}
dnsconfig: {}

View file

@ -22,9 +22,6 @@ services:
depends_on:
- mongodb
image: gravitl/netmaker:v0.3
ports:
- "8081:8081"
- "50051:50051"
volumes:
- ./:/local
- /etc/netclient:/etc/netclient
@ -39,6 +36,8 @@ services:
- SYS_MODULE
restart: always
network_mode: host
environment:
DNS_MODE: "off"
netmaker-ui:
container_name: netmaker-ui
depends_on:

View file

@ -1,38 +1,56 @@
version: "3.4"
services:
mongodb:
mongodb: # The MongoDB Instance that backs up Netmaker
image: mongo:4.2
ports:
- "27017:27017"
- "27017:27017" # Port Mapping for MongoDB. Can be modified, but be sure to change the MONGO_PORT env var in netmaker
container_name: mongodb
volumes:
- mongovol:/data/db
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: mongoadmin
MONGO_INITDB_ROOT_PASSWORD: mongopass
netmaker:
privileged: true
MONGO_INITDB_ROOT_USERNAME: mongoadmin # Default username. Recommend changing for production installs. You will need to set MONGO_ADMIN netmaker env var.
MONGO_INITDB_ROOT_PASSWORD: mongopass # Default password. Recommend changing for production installs. You will need to set MONGO_PASS netmaker env var.
netmaker: # The Primary Server for running Netmaker
privileged: true # Necessary to run sudo/root level commands on host system. Take out if not running with CLIENT_MODE=on
container_name: netmaker
depends_on:
- mongodb
image: gravitl/netmaker:v0.3
volumes:
volumes: # Volume mounts necessary for CLIENT_MODE to control netclient, wireguard, and networking on host (except dnsconfig, which is where dns config files are stored for use by CoreDNS)
- ./:/local
- /etc/netclient:/etc/netclient
- dnsconfig:/root/config/dnsconfig
- dnsconfig:/root/config/dnsconfig # Netmaker writes Corefile to this location, which gets mounted by CoreDNS for DNS configuration.
- /usr/bin/wg:/usr/bin/wg
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
- /run/systemd/system:/run/systemd/system
- /etc/systemd/system:/etc/systemd/system
- /sys/fs/cgroup:/sys/fs/cgroup
cap_add:
cap_add: # Necessary for CLIENT_MODE. Should be removed if turned off.
- NET_ADMIN
- SYS_MODULE
restart: always
network_mode: host
netmaker-ui:
network_mode: host # Necessary for CLIENT_MODE. Should be removed if turned off, but then need to add port mappings
environment:
SERVER_HOST: "" # All the Docker Compose files pre-populate this with HOST_IP, which you replace as part of the install instructions. This will set both HTTP and GRPC host.
SERVER_HTTP_HOST: "127.0.0.1" # Overrides SERVER_HOST if set. Useful for making HTTP and GRPC available via different interfaces/networks.
SERVER_GRPC_HOST: "127.0.0.1" # Overrides SERVER_HOST if set. Useful for making HTTP and GRPC available via different interfaces/networks.
API_PORT: 8081 # The HTTP API port for Netmaker. Used for API calls / communication from front end. If changed, need to change port of BACKEND_URL for netmaker-ui.
GRPC_PORT: 50051 # The GRPC port for Netmaker. Used for communications from nodes.
MASTER_KEY: "secretkey" # The admin master key for accessing the API. Change this in any production installation.
CORS_ALLOWED_ORIGIN: "*" # The "allowed origin" for API requests. Change to restrict where API requests can come from.
REST_BACKEND: "on" # Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
AGENT_BACKEND: "on" # Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to "off" to turn off.
CLIENT_MODE: "on" # Enables Client Mode, meaning netclient will be deployed on server and will be manageable from UI. Change to "off" to turn off.
DNS_MODE: "on" # Enables DNS Mode, meaning config files will be generated for CoreDNS. Note, turning "off" does not remove CoreDNS. You still need to remove CoreDNS from compose file.
DISABLE_REMOTE_IP_CHECK: "off" # If turned "on", Server will not set Host based on remote IP check. This is already overridden if SERVER_HOST is set. Turned "off" by default.
MONGO_ADMIN: "mongoadmin" # Admin user for MongoDB. Change to match above MongoDB instance
MONGO_PASS: "mongopass" # Admin password for MongoDB. Change to match above MongoDB instance
MONGO_HOST: "127.0.0.1" # Address of MongoDB. Change if necessary.
MONGO_PORT: "27017" # Port of MongoDB. Change if necessary.
MONGO_OPTS: "/?authSource=admin" # Opts to enable admin login for Mongo.
netmaker-ui: # The Netmaker UI Component
container_name: netmaker-ui
depends_on:
- netmaker
@ -42,16 +60,17 @@ services:
ports:
- "80:80"
environment:
BACKEND_URL: "http://3.236.149.180:8081"
coredns:
BACKEND_URL: "http://HOST_IP:8081" # URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT
MASTER_KEY: "secretkey" # Master Key for API calls. Will be removed in v0.3.5
coredns: # The DNS Server. Remove this section if DNS_MODE="off"
depends_on:
- netmaker
image: coredns/coredns
command: -conf /root/dnsconfig/Corefile
command: -conf /root/dnsconfig/Corefile # Config location for Corefile. This is the path of file which is also mounted to Netmaker for modification.
container_name: coredns
restart: always
ports:
- "53:53/udp"
- "53:53/udp" # Likely needs to run at port 53 for adequate nameserver usage.
volumes:
- dnsconfig:/root/dnsconfig
volumes:

View file

@ -16,7 +16,6 @@ services:
MONGO_INITDB_ROOT_USERNAME: mongoadmin
MONGO_INITDB_ROOT_PASSWORD: mongopass
netmaker:
privileged: true
container_name: netmaker
depends_on:
- mongodb
@ -33,11 +32,7 @@ services:
- /run/systemd/system:/run/systemd/system
- /etc/systemd/system:/etc/systemd/system
- /sys/fs/cgroup:/sys/fs/cgroup
cap_add:
- NET_ADMIN
- SYS_MODULE
restart: always
network_mode: host
environment:
CLIENT_MODE: "off"
DNS_MODE: "off"

View file

@ -1,8 +1,5 @@
version: "3.4"
volumes:
dnsconfig:
driver: local
services:
mongodb:
image: mongo:4.2
@ -16,19 +13,27 @@ services:
MONGO_INITDB_ROOT_USERNAME: mongoadmin
MONGO_INITDB_ROOT_PASSWORD: mongopass
netmaker:
privileged: true
container_name: netmaker
ports:
- "8081:8081"
- "50051:50051"
depends_on:
- mongodb
image: gravitl/netmaker:v0.3
volumes:
- ./:/local
- /etc/netclient:/etc/netclient
- dnsconfig:/root/config/dnsconfig
- /usr/bin/wg:/usr/bin/wg
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
- /run/systemd/system:/run/systemd/system
- /etc/systemd/system:/etc/systemd/system
- /sys/fs/cgroup:/sys/fs/cgroup
cap_add:
- NET_ADMIN
- SYS_MODULE
restart: always
network_mode: host
environment:
MONGO_HOST: "mongodb"
SERVER_HOST: "HOST_IP"
DNS_MODE: "off"
CLIENT_MODE: "off"
netmaker-ui:
container_name: netmaker-ui
depends_on:
@ -40,5 +45,17 @@ services:
- "80:80"
environment:
BACKEND_URL: "http://HOST_IP:8081"
coredns:
depends_on:
- netmaker
image: coredns/coredns
command: -conf /root/dnsconfig/Corefile
container_name: coredns
restart: always
ports:
- "53:53/udp"
volumes:
- dnsconfig:/root/dnsconfig
volumes:
mongovol: {}
dnsconfig: {}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -18,7 +18,7 @@ Prerequisites
Install
==============
#. ``ssh root@your-host``
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.quick.yml``
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.slim.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
#. ``docker-compose up -d``
@ -133,5 +133,5 @@ Uninstalling the netclient
Uninstralling Netmaker
===========================
To uninstall Netmaker from the server, simply run `docker-compose down`
To uninstall Netmaker from the server, simply run ``docker-compose down`` or ``docker-compose down --volumes`` to remove the docker volumes for a future installation.

View file

@ -1,27 +1,308 @@
============
====================
Server Installation
============
====================
This section outlines installing the Netmaker server, including Netmaker, Netmaker UI, MongoDB, and CoreDNS
Notes on Optional Features
============================
There are a few key options to keep in mind when deploying Netmaker. All of the following options are enabled by default but can be disabled with a single flag at runtime (see Customization). In addition to these options, there are many more Customizable components which will be discussed later on and help to solve for special challenges and use cases.
**Client Mode:** Client Mode enables Netmaker to control the underlying host server's Network. This can make management a bit easier, because Netmaker can be added into networks via a button click in the UI. This is especially useful for things like Gateways, and will open up additional options in future versions, for instance, allowing Netmaker to easily become a relay server.
Client Mode requires many additional privileges on the host machine, since Netmaker needs to control kernel WireGuard. Because of this, if running in Client Mode, you must run with root privileges and mount many system directories to the Netmaker container. Running without Client Mode allows you to install without privilege escalation and increases the number of compatible systems substantially.
**DNS Mode:** DNS Mode enables Netmaker to write configuration files for CoreDNS, which can be set as a DNS Server for nodes. DNS Mode, paired with a CoreDNS deployment, requires use of port 53. On many linux systems (such as Ubuntu), port 53 is already in use to support local DNS, via systemd-resolved. Running in DNS Mode may require making modifications on the host machine.
**Agent Backend:** The Agent Backend is the GRPC server (by default running on port 50051). This port is not needed for the admin server. If your use case requires special access configuration, you can run two Netmaker instances, one for the admin server, and one for node access.
**REST Backend:** Similar to the above, the REST backend runs by default on port 8081, and is used for admin API and UI access. By enabling the REST backend while disabling the Agent backend, you can separate the two functions for more restricted environments.
This document tells you how to install Netmaker.
System Compatibility
====================
Prerequisites
=============
Whether or not you run Netmaker in **Client Mode** is the main determination of system compatibility.
Installing Netmaker
===================
With Client Mode **disabled**, Netmaker can be run on any system that supports Docker. This includes Windows, Mac, Linux, mainframes, and most Unix-based systems. It also requires no special privileges. Netmaker will only need ports for GRPC (50051 by default), the API (8081 by default), and CoreDNS (53, if enabled).
Linux with Docker Compose
-------------------------
With Client Mode **enabled** (the default), Netmaker has the same limitations as the :doc:`netclient <./client-installation>` (client networking agent), because client mode just means that the Netmaker server is also running a netclient.
Linux without Docker
--------------------
This requires privileged (root) access to the host machine and multiple host directory mounts. It also requires WireGuard to be installed, and Linux with systemd installed (see :doc:`compatible systems <./architecture>` for more details).
Kubernetes
----------
To run a non-docker installation, you are running the Netmaker binary, CoreDNS binary, MongoDB, and a web server directly on your host. This requires all the requirements for those individual components. Our guided install assumes systemd-based linux, but there are many other ways to install Netmaker's individual components onto machines that do not support Docker.
Customizing your Installation
-----------------------------
DNS Mode Prereqisite Setup (Ubuntu)
====================================
If you plan on running the
Docker Compose Install
=======================
The most simple (and recommended) way of installing Netmaker is to use one of the provided `Docker Compose files <https://github.com/gravitl/netmaker/tree/feature_v0.3.5_docs/compose>`_. Below are instructions for several different options to install Netmaker via Docker Compose, followed by an annotated reference Docker Compose in case your use case requires additional customization.
Slim Install - No DNS and No Client Mode
--------------------------------------------
This is the same docker compose covered in the :doc:`quick start <./quick-start>`. It requires no special privileges and can run on any system with Docker and Docker Compose. However, it also does not have the full feature set, and lacks Client Mode and DNS Mode.
**Prerequisites:**
* ports 80, 8081, and 50051 are not blocked by firewall
* ports 80, 8081, 50051, and 27017 are not in use
**Notes:**
* You can still run the netclient on the host system even if Client Mode is not enabled. It will just be managed like the netclient on any other nodes, and will not be automatically managed by thhe server/UI.
* You can change the port mappings in the Docker Compose if the listed ports are already in use.
Assuming you have Docker and Docker Compose installed, you can just run the following, replacing **< Insert your-host IP Address Here >** with your host IP (or domain):
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.slim.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
#. ``docker-compose up -d``
Full Install - DNS and Client Mode Enabled
--------------------------------------------
This installation gives you the fully-featured product with Client Mode and DNS Mode.
**Prerequisites:**
* systemd linux (Debian or Ubuntu reccommended)
* sudo privileges
* DNS Mode Prerequisite Setup (see above)
* WireGuard installed
* ports 80, 8081, 53, and 50051 are not blocked by firewall
* ports 80, 8081, 53, 50051, and 27017 are not in use
**Notes:**
* You can change the port mappings in the Docker Compose if the listed ports are already in use.
* You can run CoreDNS on a non-53 port, but this likely will cause issues on the client side (DNS on non-standard port). We do not recommend this and do not cover how to manage running CoreDNS on a different port for clients, which will likely have problems resolving a nameserver on a non-53 port.
Assuming you have Docker and Docker Compose installed, you can just run the following, replacing **< Insert your-host IP Address Here >** with your host IP (or domain):
#. ``sudo su -``
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
#. ``docker-compose up -d``
Server Only Install - UI, DNS, Client Disabled
------------------------------------------------
A "Server Only" install can be helpful for scenarios in which you do not want to run the UI. the UI is not mandatory for running a Netmaker network, but it makes the process easier. This mode also diables DNS and Client Modes, though you can add those back in if needed. There is no UI dependency on Client Mode or DNS Mode.
**Prerequisites:**
* ports 8081 and 50051 are not blocked by firewall
* ports 8081, 50051, and 27017 are not in use
**Notes:**
* You can still run the netclient on the host system even if Client Mode is not enabled. It will just be managed like the netclient on any other nodes, and will not be automatically managed by thhe server/UI.
* You can change the port mappings in the Docker Compose if the listed ports are already in use.
Assuming you have Docker and Docker Compose installed, you can just run the following, replacing **< Insert your-host IP Address Here >** with your host IP (or domain):
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.server-only.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
No DNS - CoreDNS Disabled, Client Enabled
----------------------------------------------
DNS Mode is currently limited to clients that can run resolvectl (systemd-resolved, see :doc:`Architecture docs <./architecture>` for more info). You may wish to disable DNS mode for various reasons. This installation option gives you the full feature set minus CoreDNS.
**Prerequisites:**
* systemd linux (Debian or Ubuntu reccommended)
* sudo privileges
* WireGuard installed
* ports 80, 8081, and 50051 are not blocked by firewall
* ports 80, 8081, 50051, and 27017 are not in use
**Notes:**
* You can change the port mappings in the Docker Compose if the listed ports are already in use.
* If you would like to run DNS Mode, but disable it on some clients, this is also an option. See the :doc:`client installation <./client-installation>` documentation for more details.
Assuming you have Docker and Docker Compose installed, you can just run the following, replacing **< Insert your-host IP Address Here >** with your host IP (or domain):
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.nodns.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
No DNS - CoreDNS Disabled, Client Enabled
No Client - DNS Enabled, Client Disabled
---------------------------------------------
You may want to provide DNS, but do not want to run the server with special privileges, in which case you can run with just Client Mode disabled. It requires no special privileges and can run on any system with Docker and Docker Compose.
**Prerequisites:**
* ports 80, 8081, 53, and 50051 are not blocked by firewall
* ports 80, 8081, 53, 50051, and 27017 are not in use
* DNS Mode Prerequisite Setup (see above)
**Notes:**
* You can still run the netclient on the host system even if Client Mode is not enabled. It will just be managed like the netclient on any other nodes, and will not be automatically managed by thhe server/UI.
* You can change the port mappings in the Docker Compose if the listed ports are already in use.
Assuming you have Docker and Docker Compose installed, you can just run the following, replacing **< Insert your-host IP Address Here >** with your host IP (or domain):
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.noclient.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
#. ``docker-compose up -d``
Reference Compose File - Annotated
--------------------------------------
All environment variables and options are enabled in this file. It is the equivalent to running the "full install" from the above section. However, all environment variables are included, and are set to the default values provided by Netmaker (if the environment variable was left unset, it would not change the installation). Comments are added to each option to show how you might use it to modify your installation.
.. literalinclude:: ../compose/docker-compose.reference.yml
:language: YAML
Linux Install without Docker
=============================
Most systems support Docker, but some, such as LXC, do not. In such environments, there are many options for installing Netmaker. Netmaker is available as a binary file, and there is a zip file of the Netmaker UI static HTML on GitHub. Beyond the UI and Server, you need to install MongoDB and CoreDNS (optional).
Below is a guided set of instructions for installing without Docker on Ubuntu 20.04. Depending on your system, the steps may vary.
MongoDB Setup
----------------
1. Install MongoDB on your server:
* For Ubuntu: `sudo apt install -y mongodb`
* For more advanced installation or other operating systems, see the `MongoDB documentation <https://docs.mongodb.com/manual/administration/install-community/>`_.
2. Create a user:
* ``mongo admin``
* > `db.createUser({ user: "mongoadmin" , pwd: "mongopass", roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"]})`
Server Setup
-------------
1. **Run the install script:** ``sudo curl -sfL https://raw.githubusercontent.com/gravitl/netmaker/v0.3.5/scripts/netmaker-server.sh | sh -``
2. Check status: ``sudo journalctl -u netmaker``
3. If any settings are incorrect such as host or mongo credentials, change them under /etc/netmaker/config/environments/< your env >.yaml and then run ``sudo systemctl restart netmaker``
UI Setup
-----------
The following uses NGinx as an http server. You may alternatively use Apache or any other web server that serves static web files.
1. **Download UI asset files:** ``sudo wget -O /usr/share/nginx/html/netmaker-ui.zip https://github.com/gravitl/netmaker-ui/releases/download/latest/netmaker-ui.zip``
2. **Unzip:** ``sudo unzip /usr/share/nginx/html/netmaker-ui.zip -d /usr/share/nginx/html``
3. **Copy Config to Nginx:** ``sudo cp /usr/share/nginx/html/nginx.conf /etc/nginx/conf.d/default.conf``
4. **Modify Default Config Path:** ``sudo sed -i 's/root \/var\/www\/html/root \/usr\/share\/nginx\/html/g' /etc/nginx/sites-available/default``
5. **Change Backend URL:** ``sudo sh -c 'BACKEND_URL=http://<YOUR BACKEND API URL>:PORT /usr/share/nginx/html/generate_config_js.sh >/usr/share/nginx/html/config.js'``
6. **Start Nginx:** ``sudo systemctl start nginx``
CoreDNS Setup
----------------
Kubernetes Install
=======================
**This configuration is coming soon.** It will allow you to deploy Netmaker on a Kubernetes cluster.
Configuration Reference
=========================
The "Reference Compose File" (above) explains many of these options. However, it is important to understand fundamentally how Netmaker sets its configuration:
1. Defaults
2. Config File
3. Environment Variables
Variable Description
----------------------
SERVER_HOST:
**Default:** Server will perform an IP check and set automatically unless explicitly set, or DISABLE_REMOTE_IP_CHECK is set to true, in which case it defaults to 127.0.0.1
**Description:** Sets the SERVER_HTTP_HOST and SERVER_GRPC_HOST variables if they are unset. The address where traffic comes in.
SERVER_HTTP_HOST:
**Default:** Equals SERVER_HOST if set, "127.0.0.1" if SERVER_HOST is unset.
**Description:** Set to make the HTTP and GRPC functions available via different interfaces/networks.
SERVER_GRPC_HOST:
**Default:** Equals SERVER_HOST if set, "127.0.0.1" if SERVER_HOST is unset.
**Description:** Set to make the HTTP and GRPC functions available via different interfaces/networks.
API_PORT:
**Default:** 8081
**Description:** The HTTP API port for Netmaker. Used for API calls / communication from front end. If changed, need to change port of BACKEND_URL for netmaker-ui.
GRPC_PORT:
**Default:** 50051
**Description:** The GRPC port for Netmaker. Used for communications from nodes.
MASTER_KEY:
**Default:** "secretkey"
**Description:** The admin master key for accessing the API. Change this in any production installation.
CORS_ALLOWED_ORIGIN:
**Default:** "*"
**Description:** The "allowed origin" for API requests. Change to restrict where API requests can come from.
REST_BACKEND:
**Default:** "on"
**Description:** Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
AGENT_BACKEND:
**Default:** "on"
**Description:** Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to "off" to turn off.
CLIENT_MODE:
**Default:** "on"
**Description:** Enables Client Mode, meaning netclient will be deployed on server and will be manageable from UI. Change to "off" to turn off.
DNS_MODE:
**Default:** "on"
**Description:** Enables DNS Mode, meaning config files will be generated for CoreDNS. Note, turning "off" does not remove CoreDNS. You still need to remove CoreDNS from compose file.
DISABLE_REMOTE_IP_CHECK:
**Default:** "off"
**Description:** If turned "on", Server will not set Host based on remote IP check. This is already overridden if SERVER_HOST is set. Turned "off" by default.
MONGO_ADMIN:
**Default:** "mongoadmin"
**Description:** Admin user for MongoDB. Change to match above MongoDB instance
MONGO_PASS:
**Default:** "mongopass"
**Description:** Admin password for MongoDB. Change to match above MongoDB instance
MONGO_HOST:
**Default:** "127.0.0.1"
**Description:** Address of MongoDB. Change if necessary.
MONGO_PORT:
**Default:** "27017"
**Description:** Port of MongoDB. Change if necessary.
MONGO_OPTS:
**Default:** "/?authSource=admin"
**Description:** Opts to enable admin login for Mongo.
Config File Reference
----------------------
A config file may be placed under config/environments/<env-name>.yml. To read this file at runtime, provide the environment variable ENV at runtime. For instance, dev.yml paired with ENV=dev. Netmaker will load the specified Config file. This allows you to store and manage configurations for different environments. Below is a reference Config File you may use.
.. literalinclude:: ../config/environments/dev.yaml
:language: YAML

View file

@ -3,11 +3,12 @@ Support
=========
FAQ
=====
----
Contact
========
--------
If you need help, try the discord or open a GitHub ticket.
Email: info@gravitl.com
Discord: https://discord.gg/zRb9Vfhk8A

View file

@ -345,6 +345,13 @@
<li class="md-nav__item">
<a href="server-installation.html#notes-on-optional-features" class="md-nav__link">Notes on Optional Features</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#system-compatibility" class="md-nav__link">System Compatibility</a>
@ -352,14 +359,35 @@
<li class="md-nav__item">
<a href="server-installation.html#prerequisites" class="md-nav__link">Prerequisites</a>
<a href="server-installation.html#dns-mode-prereqisite-setup-ubuntu" class="md-nav__link">DNS Mode Prereqisite Setup (Ubuntu)</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#installing-netmaker" class="md-nav__link">Installing Netmaker</a>
<a href="server-installation.html#docker-compose-install" class="md-nav__link">Docker Compose Install</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#linux-install-without-docker" class="md-nav__link">Linux Install without Docker</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#configuration-reference" class="md-nav__link">Configuration Reference</a>
</li></ul>

View file

@ -346,6 +346,13 @@
<li class="md-nav__item">
<a href="server-installation.html#notes-on-optional-features" class="md-nav__link">Notes on Optional Features</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#system-compatibility" class="md-nav__link">System Compatibility</a>
@ -353,14 +360,35 @@
<li class="md-nav__item">
<a href="server-installation.html#prerequisites" class="md-nav__link">Prerequisites</a>
<a href="server-installation.html#dns-mode-prereqisite-setup-ubuntu" class="md-nav__link">DNS Mode Prereqisite Setup (Ubuntu)</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#installing-netmaker" class="md-nav__link">Installing Netmaker</a>
<a href="server-installation.html#docker-compose-install" class="md-nav__link">Docker Compose Install</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#linux-install-without-docker" class="md-nav__link">Linux Install without Docker</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#configuration-reference" class="md-nav__link">Configuration Reference</a>
</li></ul>
@ -749,9 +777,13 @@
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="server-installation.html">Server Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="server-installation.html#notes-on-optional-features">Notes on Optional Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="server-installation.html#system-compatibility">System Compatibility</a></li>
<li class="toctree-l2"><a class="reference internal" href="server-installation.html#prerequisites">Prerequisites</a></li>
<li class="toctree-l2"><a class="reference internal" href="server-installation.html#installing-netmaker">Installing Netmaker</a></li>
<li class="toctree-l2"><a class="reference internal" href="server-installation.html#dns-mode-prereqisite-setup-ubuntu">DNS Mode Prereqisite Setup (Ubuntu)</a></li>
<li class="toctree-l2"><a class="reference internal" href="server-installation.html#docker-compose-install">Docker Compose Install</a></li>
<li class="toctree-l2"><a class="reference internal" href="server-installation.html#linux-install-without-docker">Linux Install without Docker</a></li>
<li class="toctree-l2"><a class="reference internal" href="server-installation.html#kubernetes-install">Kubernetes Install</a></li>
<li class="toctree-l2"><a class="reference internal" href="server-installation.html#configuration-reference">Configuration Reference</a></li>
</ul>
</li>
</ul>

View file

@ -56,7 +56,7 @@
<link rel="author" title="About these documents" href="about.html" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Server Installation" href="server-installation.html" />
<link rel="next" title="Server Installation Notes" href="server-installation.html" />
<link rel="prev" title="Architecture" href="architecture.html" />
@ -376,8 +376,10 @@
<li class="md-nav__item">
<a href="server-installation.html" class="md-nav__link">Server Installation</a>
<ul class="md-nav__list">
<a href="server-installation.html" class="md-nav__link">Server Installation Notes</a>
</li>
<li class="md-nav__item">
@ -388,14 +390,96 @@
<li class="md-nav__item">
<a href="server-installation.html#prerequisites" class="md-nav__link">Prerequisites</a>
<a href="server-installation.html#dns-mode-prereqisite-setup-ubuntu" class="md-nav__link">DNS Mode Prereqisite Setup (Ubuntu)</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#installing-netmaker" class="md-nav__link">Installing Netmaker</a>
<a href="server-installation.html#docker-compose-install" class="md-nav__link">Docker Compose Install</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="server-installation.html#slim-install-no-dns-and-no-client-mode" class="md-nav__link">Slim Install - No DNS and No Client Mode</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#full-install-dns-and-client-mode-enabled" class="md-nav__link">Full Install - DNS and Client Mode Enabled</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#server-only-install-ui-dns-client-disabled" class="md-nav__link">Server Only Install - UI, DNS, Client Disabled</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#no-dns-coredns-disabled-client-enabled" class="md-nav__link">No DNS - CoreDNS Disabled, Client Enabled</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#no-client-client-enabled-coredns-disabled" class="md-nav__link">No Client - Client Enabled, CoreDNS Disabled</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#reference-compose-file-annotated" class="md-nav__link">Reference Compose File - Annotated</a>
</li></ul>
</li>
<li class="md-nav__item">
<a href="server-installation.html#linux-install-without-docker" class="md-nav__link">Linux Install without Docker</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#configuration" class="md-nav__link">Configuration</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="server-installation.html#defaults" class="md-nav__link">Defaults</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#config-file" class="md-nav__link">Config File</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#environment-variables" class="md-nav__link">Environment Variables</a>
</li></ul>
@ -735,7 +819,7 @@
<h2 id="install">Install<a class="headerlink" href="#install" title="Permalink to this headline"></a></h2>
<ol class="arabic simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ssh</span> <span class="pre">root@your-host</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">docker-compose.yml</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.quick.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">docker-compose.yml</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.slim.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">s/HOST_IP/&lt;</span> <span class="pre">Insert</span> <span class="pre">your-host</span> <span class="pre">IP</span> <span class="pre">Address</span> <span class="pre">Here</span> <span class="pre">&gt;/g</span> <span class="pre">docker-compose.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">up</span> <span class="pre">-d</span></code></p></li>
</ol>
@ -811,7 +895,7 @@
<h2 id="uninstralling-netmaker">Uninstralling Netmaker<a class="headerlink" href="#uninstralling-netmaker" title="Permalink to this headline"></a></h2>
<p>To uninstall Netmaker from the server, simply run <cite>docker-compose down</cite></p>
<p>To uninstall Netmaker from the server, simply run <code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">down</span></code> or <code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">down</span> <span class="pre">--volumes</span></code> to remove the docker volumes for a future installation.</p>
@ -839,12 +923,12 @@
</a>
<a href="server-installation.html" title="Server Installation"
<a href="server-installation.html" title="Server Installation Notes"
class="md-flex md-footer-nav__link md-footer-nav__link--next"
rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span
class="md-flex__ellipsis"> <span
class="md-footer-nav__direction"> Next </span> Server Installation </span>
class="md-footer-nav__direction"> Next </span> Server Installation Notes </span>
</div>
<div class="md-flex__cell md-flex__cell--shrink"><i
class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>

View file

@ -351,6 +351,13 @@
<li class="md-nav__item">
<a href="server-installation.html#notes-on-optional-features" class="md-nav__link">Notes on Optional Features</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#system-compatibility" class="md-nav__link">System Compatibility</a>
@ -358,14 +365,35 @@
<li class="md-nav__item">
<a href="server-installation.html#prerequisites" class="md-nav__link">Prerequisites</a>
<a href="server-installation.html#dns-mode-prereqisite-setup-ubuntu" class="md-nav__link">DNS Mode Prereqisite Setup (Ubuntu)</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#installing-netmaker" class="md-nav__link">Installing Netmaker</a>
<a href="server-installation.html#docker-compose-install" class="md-nav__link">Docker Compose Install</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#linux-install-without-docker" class="md-nav__link">Linux Install without Docker</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
</li>
<li class="md-nav__item">
<a href="server-installation.html#configuration-reference" class="md-nav__link">Configuration Reference</a>
</li></ul>

File diff suppressed because one or more lines are too long

View file

@ -263,7 +263,7 @@
<li class="md-nav__item">
<a href="architecture.html#compatible-systems" class="md-nav__link">Compatible Systems</a>
<a href="architecture.html#compatible-systems-for-netclient" class="md-nav__link">Compatible Systems for Netclient</a>
</li>
@ -280,8 +280,64 @@
<a href="quick-start.html" class="md-nav__link">Quick Start</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="quick-start.html#introduction" class="md-nav__link">Introduction</a>
</li>
<li class="md-nav__item">
<a href="quick-start.html#prerequisites" class="md-nav__link">Prerequisites</a>
</li>
<li class="md-nav__item">
<a href="quick-start.html#install" class="md-nav__link">Install</a>
</li>
<li class="md-nav__item">
<a href="quick-start.html#setup" class="md-nav__link">Setup</a>
</li>
<li class="md-nav__item">
<a href="quick-start.html#deploy-nodes" class="md-nav__link">Deploy Nodes</a>
</li>
<li class="md-nav__item">
<a href="quick-start.html#manage-nodes" class="md-nav__link">Manage Nodes</a>
</li>
<li class="md-nav__item">
<a href="quick-start.html#uninstalling-the-netclient" class="md-nav__link">Uninstalling the netclient</a>
</li>
<li class="md-nav__item">
<a href="quick-start.html#uninstralling-netmaker" class="md-nav__link">Uninstralling Netmaker</a>
</li></ul>
</li>
<li class="md-nav__item">
@ -297,19 +353,47 @@
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item"><a href="#server-installation--page-root" class="md-nav__link">Server Installation</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#notes-on-optional-features" class="md-nav__link">Notes on Optional Features</a>
</li>
<li class="md-nav__item"><a href="#system-compatibility" class="md-nav__link">System Compatibility</a>
</li>
<li class="md-nav__item"><a href="#prerequisites" class="md-nav__link">Prerequisites</a>
<li class="md-nav__item"><a href="#dns-mode-prereqisite-setup-ubuntu" class="md-nav__link">DNS Mode Prereqisite Setup (Ubuntu)</a>
</li>
<li class="md-nav__item"><a href="#installing-netmaker" class="md-nav__link">Installing Netmaker</a><nav class="md-nav">
<li class="md-nav__item"><a href="#docker-compose-install" class="md-nav__link">Docker Compose Install</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#linux-with-docker-compose" class="md-nav__link">Linux with Docker Compose</a>
<li class="md-nav__item"><a href="#slim-install-no-dns-and-no-client-mode" class="md-nav__link">Slim Install - No DNS and No Client Mode</a>
</li>
<li class="md-nav__item"><a href="#linux-without-docker" class="md-nav__link">Linux without Docker</a>
<li class="md-nav__item"><a href="#full-install-dns-and-client-mode-enabled" class="md-nav__link">Full Install - DNS and Client Mode Enabled</a>
</li>
<li class="md-nav__item"><a href="#kubernetes" class="md-nav__link">Kubernetes</a>
<li class="md-nav__item"><a href="#server-only-install-ui-dns-client-disabled" class="md-nav__link">Server Only Install - UI, DNS, Client Disabled</a>
</li>
<li class="md-nav__item"><a href="#customizing-your-installation" class="md-nav__link">Customizing your Installation</a>
<li class="md-nav__item"><a href="#no-dns-coredns-disabled-client-enabled" class="md-nav__link">No DNS - CoreDNS Disabled, Client Enabled</a>
</li>
<li class="md-nav__item"><a href="#no-client-dns-enabled-client-disabled" class="md-nav__link">No Client - DNS Enabled, Client Disabled</a>
</li>
<li class="md-nav__item"><a href="#reference-compose-file-annotated" class="md-nav__link">Reference Compose File - Annotated</a>
</li></ul>
</nav>
</li>
<li class="md-nav__item"><a href="#linux-install-without-docker" class="md-nav__link">Linux Install without Docker</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#mongodb-setup" class="md-nav__link">MongoDB Setup</a>
</li>
<li class="md-nav__item"><a href="#server-setup" class="md-nav__link">Server Setup</a>
</li>
<li class="md-nav__item"><a href="#ui-setup" class="md-nav__link">UI Setup</a>
</li>
<li class="md-nav__item"><a href="#coredns-setup" class="md-nav__link">CoreDNS Setup</a>
</li></ul>
</nav>
</li>
<li class="md-nav__item"><a href="#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
</li>
<li class="md-nav__item"><a href="#configuration-reference" class="md-nav__link">Configuration Reference</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#variable-description" class="md-nav__link">Variable Description</a>
</li>
<li class="md-nav__item"><a href="#config-file-reference" class="md-nav__link">Config File Reference</a>
</li></ul>
</nav>
</li></ul>
@ -321,6 +405,13 @@
<li class="md-nav__item">
<a href="#notes-on-optional-features" class="md-nav__link">Notes on Optional Features</a>
</li>
<li class="md-nav__item">
<a href="#system-compatibility" class="md-nav__link">System Compatibility</a>
@ -328,14 +419,35 @@
<li class="md-nav__item">
<a href="#prerequisites" class="md-nav__link">Prerequisites</a>
<a href="#dns-mode-prereqisite-setup-ubuntu" class="md-nav__link">DNS Mode Prereqisite Setup (Ubuntu)</a>
</li>
<li class="md-nav__item">
<a href="#installing-netmaker" class="md-nav__link">Installing Netmaker</a>
<a href="#docker-compose-install" class="md-nav__link">Docker Compose Install</a>
</li>
<li class="md-nav__item">
<a href="#linux-install-without-docker" class="md-nav__link">Linux Install without Docker</a>
</li>
<li class="md-nav__item">
<a href="#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
</li>
<li class="md-nav__item">
<a href="#configuration-reference" class="md-nav__link">Configuration Reference</a>
</li></ul>
@ -463,19 +575,54 @@
<li class="md-nav__item">
<a href="support.html" class="md-nav__link">Support</a>
<a href="troubleshoot.html" class="md-nav__link">Troubleshooting</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="support.html#faq" class="md-nav__link">FAQ</a>
<a href="troubleshoot.html#common-issues" class="md-nav__link">Common Issues</a>
</li>
<li class="md-nav__item">
<a href="support.html#troubleshooting" class="md-nav__link">Troubleshooting</a>
<a href="troubleshoot.html#server" class="md-nav__link">Server</a>
</li>
<li class="md-nav__item">
<a href="troubleshoot.html#ui" class="md-nav__link">UI</a>
</li>
<li class="md-nav__item">
<a href="troubleshoot.html#agent" class="md-nav__link">Agent</a>
</li>
<li class="md-nav__item">
<a href="troubleshoot.html#coredns" class="md-nav__link">CoreDNS</a>
</li></ul>
</li>
<li class="md-nav__item">
<a href="support.html" class="md-nav__link">Support</a>
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="support.html#faq" class="md-nav__link">FAQ</a>
</li>
@ -588,19 +735,47 @@
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item"><a href="#server-installation--page-root" class="md-nav__link">Server Installation</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#notes-on-optional-features" class="md-nav__link">Notes on Optional Features</a>
</li>
<li class="md-nav__item"><a href="#system-compatibility" class="md-nav__link">System Compatibility</a>
</li>
<li class="md-nav__item"><a href="#prerequisites" class="md-nav__link">Prerequisites</a>
<li class="md-nav__item"><a href="#dns-mode-prereqisite-setup-ubuntu" class="md-nav__link">DNS Mode Prereqisite Setup (Ubuntu)</a>
</li>
<li class="md-nav__item"><a href="#installing-netmaker" class="md-nav__link">Installing Netmaker</a><nav class="md-nav">
<li class="md-nav__item"><a href="#docker-compose-install" class="md-nav__link">Docker Compose Install</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#linux-with-docker-compose" class="md-nav__link">Linux with Docker Compose</a>
<li class="md-nav__item"><a href="#slim-install-no-dns-and-no-client-mode" class="md-nav__link">Slim Install - No DNS and No Client Mode</a>
</li>
<li class="md-nav__item"><a href="#linux-without-docker" class="md-nav__link">Linux without Docker</a>
<li class="md-nav__item"><a href="#full-install-dns-and-client-mode-enabled" class="md-nav__link">Full Install - DNS and Client Mode Enabled</a>
</li>
<li class="md-nav__item"><a href="#kubernetes" class="md-nav__link">Kubernetes</a>
<li class="md-nav__item"><a href="#server-only-install-ui-dns-client-disabled" class="md-nav__link">Server Only Install - UI, DNS, Client Disabled</a>
</li>
<li class="md-nav__item"><a href="#customizing-your-installation" class="md-nav__link">Customizing your Installation</a>
<li class="md-nav__item"><a href="#no-dns-coredns-disabled-client-enabled" class="md-nav__link">No DNS - CoreDNS Disabled, Client Enabled</a>
</li>
<li class="md-nav__item"><a href="#no-client-dns-enabled-client-disabled" class="md-nav__link">No Client - DNS Enabled, Client Disabled</a>
</li>
<li class="md-nav__item"><a href="#reference-compose-file-annotated" class="md-nav__link">Reference Compose File - Annotated</a>
</li></ul>
</nav>
</li>
<li class="md-nav__item"><a href="#linux-install-without-docker" class="md-nav__link">Linux Install without Docker</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#mongodb-setup" class="md-nav__link">MongoDB Setup</a>
</li>
<li class="md-nav__item"><a href="#server-setup" class="md-nav__link">Server Setup</a>
</li>
<li class="md-nav__item"><a href="#ui-setup" class="md-nav__link">UI Setup</a>
</li>
<li class="md-nav__item"><a href="#coredns-setup" class="md-nav__link">CoreDNS Setup</a>
</li></ul>
</nav>
</li>
<li class="md-nav__item"><a href="#kubernetes-install" class="md-nav__link">Kubernetes Install</a>
</li>
<li class="md-nav__item"><a href="#configuration-reference" class="md-nav__link">Configuration Reference</a><nav class="md-nav">
<ul class="md-nav__list">
<li class="md-nav__item"><a href="#variable-description" class="md-nav__link">Variable Description</a>
</li>
<li class="md-nav__item"><a href="#config-file-reference" class="md-nav__link">Config File Reference</a>
</li></ul>
</nav>
</li></ul>
@ -617,26 +792,374 @@
<h1 id="server-installation--page-root">Server Installation<a class="headerlink" href="#server-installation--page-root" title="Permalink to this headline"></a></h1>
<p>This document tells you how to install Netmaker.</p>
<p>This section outlines installing the Netmaker server, including Netmaker, Netmaker UI, MongoDB, and CoreDNS</p>
<h2 id="notes-on-optional-features">Notes on Optional Features<a class="headerlink" href="#notes-on-optional-features" title="Permalink to this headline"></a></h2>
<p>There are a few key options to keep in mind when deploying Netmaker. All of the following options are enabled by default but can be disabled with a single flag at runtime (see Customization). In addition to these options, there are many more Customizable components which will be discussed later on and help to solve for special challenges and use cases.</p>
<p><strong>Client Mode:</strong> Client Mode enables Netmaker to control the underlying host servers Network. This can make management a bit easier, because Netmaker can be added into networks via a button click in the UI. This is especially useful for things like Gateways, and will open up additional options in future versions, for instance, allowing Netmaker to easily become a relay server.</p>
<p>Client Mode requires many additional privileges on the host machine, since Netmaker needs to control kernel WireGuard. Because of this, if running in Client Mode, you must run with root privileges and mount many system directories to the Netmaker container. Running without Client Mode allows you to install without privilege escalation and increases the number of compatible systems substantially.</p>
<p><strong>DNS Mode:</strong> DNS Mode enables Netmaker to write configuration files for CoreDNS, which can be set as a DNS Server for nodes. DNS Mode, paired with a CoreDNS deployment, requires use of port 53. On many linux systems (such as Ubuntu), port 53 is already in use to support local DNS, via systemd-resolved. Running in DNS Mode may require making modifications on the host machine.</p>
<p><strong>Agent Backend:</strong> The Agent Backend is the GRPC server (by default running on port 50051). This port is not needed for the admin server. If your use case requires special access configuration, you can run two Netmaker instances, one for the admin server, and one for node access.</p>
<p><strong>REST Backend:</strong> Similar to the above, the REST backend runs by default on port 8081, and is used for admin API and UI access. By enabling the REST backend while disabling the Agent backend, you can separate the two functions for more restricted environments.</p>
<h2 id="system-compatibility">System Compatibility<a class="headerlink" href="#system-compatibility" title="Permalink to this headline"></a></h2>
<p>Whether or not you run Netmaker in <strong>Client Mode</strong> is the main determination of system compatibility.</p>
<p>With Client Mode <strong>disabled</strong>, Netmaker can be run on any system that supports Docker. This includes Windows, Mac, Linux, mainframes, and most Unix-based systems. It also requires no special privileges. Netmaker will only need ports for GRPC (50051 by default), the API (8081 by default), and CoreDNS (53, if enabled).</p>
<p>With Client Mode <strong>enabled</strong> (the default), Netmaker has the same limitations as the <a class="reference internal" href="client-installation.html"><span class="doc">netclient</span></a> (client networking agent), because client mode just means that the Netmaker server is also running a netclient.</p>
<p>This requires privileged (root) access to the host machine and multiple host directory mounts. It also requires WireGuard to be installed, and Linux with systemd installed (see <a class="reference internal" href="architecture.html"><span class="doc">compatible systems</span></a> for more details).</p>
<p>To run a non-docker installation, you are running the Netmaker binary, CoreDNS binary, MongoDB, and a web server directly on your host. This requires all the requirements for those individual components. Our guided install assumes systemd-based linux, but there are many other ways to install Netmakers individual components onto machines that do not support Docker.</p>
<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline"></a></h2>
<h2 id="dns-mode-prereqisite-setup-ubuntu">DNS Mode Prereqisite Setup (Ubuntu)<a class="headerlink" href="#dns-mode-prereqisite-setup-ubuntu" title="Permalink to this headline"></a></h2>
<p>If you plan on running the</p>
<h2 id="installing-netmaker">Installing Netmaker<a class="headerlink" href="#installing-netmaker" title="Permalink to this headline"></a></h2>
<h2 id="docker-compose-install">Docker Compose Install<a class="headerlink" href="#docker-compose-install" title="Permalink to this headline"></a></h2>
<p>The most simple (and recommended) way of installing Netmaker is to use one of the provided <a class="reference external" href="https://github.com/gravitl/netmaker/tree/feature_v0.3.5_docs/compose">Docker Compose files</a>. Below are instructions for several different options to install Netmaker via Docker Compose, followed by an annotated reference Docker Compose in case your use case requires additional customization.</p>
<h3 id="linux-with-docker-compose">Linux with Docker Compose<a class="headerlink" href="#linux-with-docker-compose" title="Permalink to this headline"></a></h3>
<h3 id="slim-install-no-dns-and-no-client-mode">Slim Install - No DNS and No Client Mode<a class="headerlink" href="#slim-install-no-dns-and-no-client-mode" title="Permalink to this headline"></a></h3>
<p>This is the same docker compose covered in the <a class="reference internal" href="quick-start.html"><span class="doc">quick start</span></a>. It requires no special privileges and can run on any system with Docker and Docker Compose. However, it also does not have the full feature set, and lacks Client Mode and DNS Mode.</p>
<dl class="simple">
<dt><strong>Prerequisites:</strong></dt><dd><ul class="simple">
<li><p>ports 80, 8081, and 50051 are not blocked by firewall</p></li>
<li><p>ports 80, 8081, 50051, and 27017 are not in use</p></li>
</ul>
</dd>
<dt><strong>Notes:</strong></dt><dd><ul class="simple">
<li><p>You can still run the netclient on the host system even if Client Mode is not enabled. It will just be managed like the netclient on any other nodes, and will not be automatically managed by thhe server/UI.</p></li>
<li><p>You can change the port mappings in the Docker Compose if the listed ports are already in use.</p></li>
</ul>
</dd>
</dl>
<p>Assuming you have Docker and Docker Compose installed, you can just run the following, replacing <strong>&lt; Insert your-host IP Address Here &gt;</strong> with your host IP (or domain):</p>
<ol class="arabic simple">
<li><p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">docker-compose.yml</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.slim.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">s/HOST_IP/&lt;</span> <span class="pre">Insert</span> <span class="pre">your-host</span> <span class="pre">IP</span> <span class="pre">Address</span> <span class="pre">Here</span> <span class="pre">&gt;/g</span> <span class="pre">docker-compose.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">up</span> <span class="pre">-d</span></code></p></li>
</ol>
<h3 id="linux-without-docker">Linux without Docker<a class="headerlink" href="#linux-without-docker" title="Permalink to this headline"></a></h3>
<h3 id="full-install-dns-and-client-mode-enabled">Full Install - DNS and Client Mode Enabled<a class="headerlink" href="#full-install-dns-and-client-mode-enabled" title="Permalink to this headline"></a></h3>
<p>This installation gives you the fully-featured product with Client Mode and DNS Mode.</p>
<dl class="simple">
<dt><strong>Prerequisites:</strong></dt><dd><ul class="simple">
<li><p>systemd linux (Debian or Ubuntu reccommended)</p></li>
<li><p>sudo privileges</p></li>
<li><p>DNS Mode Prerequisite Setup (see above)</p></li>
<li><p>WireGuard installed</p></li>
<li><p>ports 80, 8081, 53, and 50051 are not blocked by firewall</p></li>
<li><p>ports 80, 8081, 53, 50051, and 27017 are not in use</p></li>
</ul>
</dd>
<dt><strong>Notes:</strong></dt><dd><ul class="simple">
<li><p>You can change the port mappings in the Docker Compose if the listed ports are already in use.</p></li>
<li><p>You can run CoreDNS on a non-53 port, but this likely will cause issues on the client side (DNS on non-standard port). We do not recommend this and do not cover how to manage running CoreDNS on a different port for clients, which will likely have problems resolving a nameserver on a non-53 port.</p></li>
</ul>
</dd>
</dl>
<p>Assuming you have Docker and Docker Compose installed, you can just run the following, replacing <strong>&lt; Insert your-host IP Address Here &gt;</strong> with your host IP (or domain):</p>
<ol class="arabic simple">
<li><p><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">su</span> <span class="pre">-</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">docker-compose.yml</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">s/HOST_IP/&lt;</span> <span class="pre">Insert</span> <span class="pre">your-host</span> <span class="pre">IP</span> <span class="pre">Address</span> <span class="pre">Here</span> <span class="pre">&gt;/g</span> <span class="pre">docker-compose.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">up</span> <span class="pre">-d</span></code></p></li>
</ol>
<h3 id="kubernetes">Kubernetes<a class="headerlink" href="#kubernetes" title="Permalink to this headline"></a></h3>
<h3 id="server-only-install-ui-dns-client-disabled">Server Only Install - UI, DNS, Client Disabled<a class="headerlink" href="#server-only-install-ui-dns-client-disabled" title="Permalink to this headline"></a></h3>
<p>A “Server Only” install can be helpful for scenarios in which you do not want to run the UI. the UI is not mandatory for running a Netmaker network, but it makes the process easier. This mode also diables DNS and Client Modes, though you can add those back in if needed. There is no UI dependency on Client Mode or DNS Mode.</p>
<dl class="simple">
<dt><strong>Prerequisites:</strong></dt><dd><ul class="simple">
<li><p>ports 8081 and 50051 are not blocked by firewall</p></li>
<li><p>ports 8081, 50051, and 27017 are not in use</p></li>
</ul>
</dd>
<dt><strong>Notes:</strong></dt><dd><ul class="simple">
<li><p>You can still run the netclient on the host system even if Client Mode is not enabled. It will just be managed like the netclient on any other nodes, and will not be automatically managed by thhe server/UI.</p></li>
<li><p>You can change the port mappings in the Docker Compose if the listed ports are already in use.</p></li>
</ul>
</dd>
</dl>
<p>Assuming you have Docker and Docker Compose installed, you can just run the following, replacing <strong>&lt; Insert your-host IP Address Here &gt;</strong> with your host IP (or domain):</p>
<ol class="arabic simple">
<li><p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">docker-compose.yml</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.server-only.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">s/HOST_IP/&lt;</span> <span class="pre">Insert</span> <span class="pre">your-host</span> <span class="pre">IP</span> <span class="pre">Address</span> <span class="pre">Here</span> <span class="pre">&gt;/g</span> <span class="pre">docker-compose.yml</span></code></p></li>
</ol>
<h3 id="customizing-your-installation">Customizing your Installation<a class="headerlink" href="#customizing-your-installation" title="Permalink to this headline"></a></h3>
<h3 id="no-dns-coredns-disabled-client-enabled">No DNS - CoreDNS Disabled, Client Enabled<a class="headerlink" href="#no-dns-coredns-disabled-client-enabled" title="Permalink to this headline"></a></h3>
<p>DNS Mode is currently limited to clients that can run resolvectl (systemd-resolved, see <a class="reference internal" href="architecture.html"><span class="doc">Architecture docs</span></a> for more info). You may wish to disable DNS mode for various reasons. This installation option gives you the full feature set minus CoreDNS.</p>
<dl class="simple">
<dt><strong>Prerequisites:</strong></dt><dd><ul class="simple">
<li><p>systemd linux (Debian or Ubuntu reccommended)</p></li>
<li><p>sudo privileges</p></li>
<li><p>WireGuard installed</p></li>
<li><p>ports 80, 8081, and 50051 are not blocked by firewall</p></li>
<li><p>ports 80, 8081, 50051, and 27017 are not in use</p></li>
</ul>
</dd>
<dt><strong>Notes:</strong></dt><dd><ul class="simple">
<li><p>You can change the port mappings in the Docker Compose if the listed ports are already in use.</p></li>
<li><p>If you would like to run DNS Mode, but disable it on some clients, this is also an option. See the <a class="reference internal" href="client-installation.html"><span class="doc">client installation</span></a> documentation for more details.</p></li>
</ul>
</dd>
</dl>
<p>Assuming you have Docker and Docker Compose installed, you can just run the following, replacing <strong>&lt; Insert your-host IP Address Here &gt;</strong> with your host IP (or domain):</p>
<ol class="arabic simple">
<li><p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">docker-compose.yml</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.nodns.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">s/HOST_IP/&lt;</span> <span class="pre">Insert</span> <span class="pre">your-host</span> <span class="pre">IP</span> <span class="pre">Address</span> <span class="pre">Here</span> <span class="pre">&gt;/g</span> <span class="pre">docker-compose.yml</span></code></p></li>
</ol>
<p>No DNS - CoreDNS Disabled, Client Enabled</p>
<h3 id="no-client-dns-enabled-client-disabled">No Client - DNS Enabled, Client Disabled<a class="headerlink" href="#no-client-dns-enabled-client-disabled" title="Permalink to this headline"></a></h3>
<p>You may want to provide DNS, but do not want to run the server with special privileges, in which case you can run with just Client Mode disabled. It requires no special privileges and can run on any system with Docker and Docker Compose.</p>
<dl class="simple">
<dt><strong>Prerequisites:</strong></dt><dd><ul class="simple">
<li><p>ports 80, 8081, 53, and 50051 are not blocked by firewall</p></li>
<li><p>ports 80, 8081, 53, 50051, and 27017 are not in use</p></li>
<li><p>DNS Mode Prerequisite Setup (see above)</p></li>
</ul>
</dd>
<dt><strong>Notes:</strong></dt><dd><ul class="simple">
<li><p>You can still run the netclient on the host system even if Client Mode is not enabled. It will just be managed like the netclient on any other nodes, and will not be automatically managed by thhe server/UI.</p></li>
<li><p>You can change the port mappings in the Docker Compose if the listed ports are already in use.</p></li>
</ul>
</dd>
</dl>
<p>Assuming you have Docker and Docker Compose installed, you can just run the following, replacing <strong>&lt; Insert your-host IP Address Here &gt;</strong> with your host IP (or domain):</p>
<ol class="arabic simple">
<li><p><code class="docutils literal notranslate"><span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">docker-compose.yml</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.noclient.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">s/HOST_IP/&lt;</span> <span class="pre">Insert</span> <span class="pre">your-host</span> <span class="pre">IP</span> <span class="pre">Address</span> <span class="pre">Here</span> <span class="pre">&gt;/g</span> <span class="pre">docker-compose.yml</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">docker-compose</span> <span class="pre">up</span> <span class="pre">-d</span></code></p></li>
</ol>
<h3 id="reference-compose-file-annotated">Reference Compose File - Annotated<a class="headerlink" href="#reference-compose-file-annotated" title="Permalink to this headline"></a></h3>
<p>All environment variables and options are enabled in this file. It is the equivalent to running the “full install” from the above section. However, all environment variables are included, and are set to the default values provided by Netmaker (if the environment variable was left unset, it would not change the installation). Comments are added to each option to show how you might use it to modify your installation.</p>
<div class="highlight-YAML notranslate"><div class="highlight"><pre><span></span><span class="nt">version</span><span class="p">:</span> <span class="s">"3.4"</span>
<span class="nt">services</span><span class="p">:</span>
<span class="nt">mongodb</span><span class="p">:</span> <span class="c1"># The MongoDB Instance that backs up Netmaker</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mongo:4.2</span>
<span class="nt">ports</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="s">"27017:27017"</span> <span class="c1"># Port Mapping for MongoDB. Can be modified, but be sure to change the MONGO_PORT env var in netmaker</span>
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mongodb</span>
<span class="nt">volumes</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mongovol:/data/db</span>
<span class="nt">restart</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">always</span>
<span class="nt">environment</span><span class="p">:</span>
<span class="nt">MONGO_INITDB_ROOT_USERNAME</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mongoadmin</span> <span class="c1"># Default username. Recommend changing for production installs. You will need to set MONGO_ADMIN netmaker env var.</span>
<span class="nt">MONGO_INITDB_ROOT_PASSWORD</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">mongopass</span> <span class="c1"># Default password. Recommend changing for production installs. You will need to set MONGO_PASS netmaker env var.</span>
<span class="nt">netmaker</span><span class="p">:</span> <span class="c1"># The Primary Server for running Netmaker</span>
<span class="nt">privileged</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span> <span class="c1"># Necessary to run sudo/root level commands on host system. Take out if not running with CLIENT_MODE=on</span>
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">netmaker</span>
<span class="nt">depends_on</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">mongodb</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">gravitl/netmaker:v0.3</span>
<span class="nt">volumes</span><span class="p">:</span> <span class="c1"># Volume mounts necessary for CLIENT_MODE to control netclient, wireguard, and networking on host (except dnsconfig, which is where dns config files are stored for use by CoreDNS)</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">./:/local</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/etc/netclient:/etc/netclient</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">dnsconfig:/root/config/dnsconfig</span> <span class="c1"># Netmaker writes Corefile to this location, which gets mounted by CoreDNS for DNS configuration.</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/usr/bin/wg:/usr/bin/wg</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/run/systemd/system:/run/systemd/system</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/etc/systemd/system:/etc/systemd/system</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/sys/fs/cgroup:/sys/fs/cgroup</span>
<span class="nt">cap_add</span><span class="p">:</span> <span class="c1"># Necessary for CLIENT_MODE. Should be removed if turned off. </span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">NET_ADMIN</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">SYS_MODULE</span>
<span class="nt">restart</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">always</span>
<span class="nt">network_mode</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">host</span> <span class="c1"># Necessary for CLIENT_MODE. Should be removed if turned off, but then need to add port mappings</span>
<span class="nt">environment</span><span class="p">:</span>
<span class="nt">SERVER_HOST</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># All the Docker Compose files pre-populate this with HOST_IP, which you replace as part of the install instructions. This will set both HTTP and GRPC host.</span>
<span class="nt">SERVER_HTTP_HOST</span><span class="p">:</span> <span class="s">"127.0.0.1"</span> <span class="c1"># Overrides SERVER_HOST if set. Useful for making HTTP and GRPC available via different interfaces/networks.</span>
<span class="nt">SERVER_GRPC_HOST</span><span class="p">:</span> <span class="s">"127.0.0.1"</span> <span class="c1"># Overrides SERVER_HOST if set. Useful for making HTTP and GRPC available via different interfaces/networks.</span>
<span class="nt">API_PORT</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">8081</span> <span class="c1"># The HTTP API port for Netmaker. Used for API calls / communication from front end. If changed, need to change port of BACKEND_URL for netmaker-ui.</span>
<span class="nt">GRPC_PORT</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">50051</span> <span class="c1"># The GRPC port for Netmaker. Used for communications from nodes.</span>
<span class="nt">MASTER_KEY</span><span class="p">:</span> <span class="s">"secretkey"</span> <span class="c1"># The admin master key for accessing the API. Change this in any production installation.</span>
<span class="nt">CORS_ALLOWED_ORIGIN</span><span class="p">:</span> <span class="s">"*"</span> <span class="c1"># The "allowed origin" for API requests. Change to restrict where API requests can come from.</span>
<span class="nt">REST_BACKEND</span><span class="p">:</span> <span class="s">"on"</span> <span class="c1"># Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.</span>
<span class="nt">AGENT_BACKEND</span><span class="p">:</span> <span class="s">"on"</span> <span class="c1"># Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to "off" to turn off.</span>
<span class="nt">CLIENT_MODE</span><span class="p">:</span> <span class="s">"on"</span> <span class="c1"># Enables Client Mode, meaning netclient will be deployed on server and will be manageable from UI. Change to "off" to turn off.</span>
<span class="nt">DNS_MODE</span><span class="p">:</span> <span class="s">"on"</span> <span class="c1"># Enables DNS Mode, meaning config files will be generated for CoreDNS. Note, turning "off" does not remove CoreDNS. You still need to remove CoreDNS from compose file.</span>
<span class="nt">DISABLE_REMOTE_IP_CHECK</span><span class="p">:</span> <span class="s">"off"</span> <span class="c1"># If turned "on", Server will not set Host based on remote IP check. This is already overridden if SERVER_HOST is set. Turned "off" by default.</span>
<span class="nt">MONGO_ADMIN</span><span class="p">:</span> <span class="s">"mongoadmin"</span> <span class="c1"># Admin user for MongoDB. Change to match above MongoDB instance</span>
<span class="nt">MONGO_PASS</span><span class="p">:</span> <span class="s">"mongopass"</span> <span class="c1"># Admin password for MongoDB. Change to match above MongoDB instance</span>
<span class="nt">MONGO_HOST</span><span class="p">:</span> <span class="s">"127.0.0.1"</span> <span class="c1"># Address of MongoDB. Change if necessary.</span>
<span class="nt">MONGO_PORT</span><span class="p">:</span> <span class="s">"27017"</span> <span class="c1"># Port of MongoDB. Change if necessary.</span>
<span class="nt">MONGO_OPTS</span><span class="p">:</span> <span class="s">"/?authSource=admin"</span> <span class="c1"># Opts to enable admin login for Mongo.</span>
<span class="nt">netmaker-ui</span><span class="p">:</span> <span class="c1"># The Netmaker UI Component</span>
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">netmaker-ui</span>
<span class="nt">depends_on</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">netmaker</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">gravitl/netmaker-ui:v0.3</span>
<span class="nt">links</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="s">"netmaker:api"</span>
<span class="nt">ports</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="s">"80:80"</span>
<span class="nt">environment</span><span class="p">:</span>
<span class="nt">BACKEND_URL</span><span class="p">:</span> <span class="s">"http://HOST_IP:8081"</span> <span class="c1"># URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORT</span>
<span class="nt">MASTER_KEY</span><span class="p">:</span> <span class="s">"secretkey"</span> <span class="c1"># Master Key for API calls. Will be removed in v0.3.5</span>
<span class="nt">coredns</span><span class="p">:</span> <span class="c1"># The DNS Server. Remove this section if DNS_MODE="off"</span>
<span class="nt">depends_on</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">netmaker</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">coredns/coredns</span>
<span class="nt">command</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">-conf /root/dnsconfig/Corefile</span> <span class="c1"># Config location for Corefile. This is the path of file which is also mounted to Netmaker for modification.</span>
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">coredns</span>
<span class="nt">restart</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">always</span>
<span class="nt">ports</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="s">"53:53/udp"</span> <span class="c1"># Likely needs to run at port 53 for adequate nameserver usage.</span>
<span class="nt">volumes</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">dnsconfig:/root/dnsconfig</span>
<span class="nt">volumes</span><span class="p">:</span>
<span class="nt">mongovol</span><span class="p">:</span> <span class="p p-Indicator">{}</span>
<span class="nt">dnsconfig</span><span class="p">:</span> <span class="p p-Indicator">{}</span>
</pre></div>
</div>
<h2 id="linux-install-without-docker">Linux Install without Docker<a class="headerlink" href="#linux-install-without-docker" title="Permalink to this headline"></a></h2>
<p>Most systems support Docker, but some, such as LXC, do not. In such environments, there are many options for installing Netmaker. Netmaker is available as a binary file, and there is a zip file of the Netmaker UI static HTML on GitHub. Beyond the UI and Server, you need to install MongoDB and CoreDNS (optional).</p>
<p>Below is a guided set of instructions for installing without Docker on Ubuntu 20.04. Depending on your system, the steps may vary.</p>
<h3 id="mongodb-setup">MongoDB Setup<a class="headerlink" href="#mongodb-setup" title="Permalink to this headline"></a></h3>
<ol class="arabic simple">
<li><dl class="simple">
<dt>Install MongoDB on your server:</dt><dd><ul class="simple">
<li><p>For Ubuntu: <cite>sudo apt install -y mongodb</cite></p></li>
<li><p>For more advanced installation or other operating systems, see the <a class="reference external" href="https://docs.mongodb.com/manual/administration/install-community/">MongoDB documentation</a>.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>Create a user:</dt><dd><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">mongo</span> <span class="pre">admin</span></code></p></li>
<li><p>&gt; <cite>db.createUser({ user: “mongoadmin” , pwd: “mongopass”, roles: [“userAdminAnyDatabase”, “dbAdminAnyDatabase”, “readWriteAnyDatabase”]})</cite></p></li>
</ul>
</dd>
</dl>
</li>
</ol>
<h3 id="server-setup">Server Setup<a class="headerlink" href="#server-setup" title="Permalink to this headline"></a></h3>
<ol class="arabic simple">
<li><p><strong>Run the install script:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">curl</span> <span class="pre">-sfL</span> <span class="pre">https://raw.githubusercontent.com/gravitl/netmaker/v0.3.5/scripts/netmaker-server.sh</span> <span class="pre">|</span> <span class="pre">sh</span> <span class="pre">-</span></code></p></li>
<li><p>Check status: <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">journalctl</span> <span class="pre">-u</span> <span class="pre">netmaker</span></code></p></li>
<li><p>If any settings are incorrect such as host or mongo credentials, change them under /etc/netmaker/config/environments/&lt; your env &gt;.yaml and then run <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">systemctl</span> <span class="pre">restart</span> <span class="pre">netmaker</span></code></p></li>
</ol>
<h3 id="ui-setup">UI Setup<a class="headerlink" href="#ui-setup" title="Permalink to this headline"></a></h3>
<p>The following uses NGinx as an http server. You may alternatively use Apache or any other web server that serves static web files.</p>
<ol class="arabic simple">
<li><p><strong>Download UI asset files:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">wget</span> <span class="pre">-O</span> <span class="pre">/usr/share/nginx/html/netmaker-ui.zip</span> <span class="pre">https://github.com/gravitl/netmaker-ui/releases/download/latest/netmaker-ui.zip</span></code></p></li>
<li><p><strong>Unzip:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">unzip</span> <span class="pre">/usr/share/nginx/html/netmaker-ui.zip</span> <span class="pre">-d</span> <span class="pre">/usr/share/nginx/html</span></code></p></li>
<li><p><strong>Copy Config to Nginx:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">cp</span> <span class="pre">/usr/share/nginx/html/nginx.conf</span> <span class="pre">/etc/nginx/conf.d/default.conf</span></code></p></li>
<li><p><strong>Modify Default Config Path:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">sed</span> <span class="pre">-i</span> <span class="pre">'s/root</span> <span class="pre">\/var\/www\/html/root</span> <span class="pre">\/usr\/share\/nginx\/html/g'</span> <span class="pre">/etc/nginx/sites-available/default</span></code></p></li>
<li><p><strong>Change Backend URL:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">sh</span> <span class="pre">-c</span> <span class="pre">'BACKEND_URL=http://&lt;YOUR</span> <span class="pre">BACKEND</span> <span class="pre">API</span> <span class="pre">URL&gt;:PORT</span> <span class="pre">/usr/share/nginx/html/generate_config_js.sh</span> <span class="pre">&gt;/usr/share/nginx/html/config.js'</span></code></p></li>
<li><p><strong>Start Nginx:</strong> <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">systemctl</span> <span class="pre">start</span> <span class="pre">nginx</span></code></p></li>
</ol>
<h3 id="coredns-setup">CoreDNS Setup<a class="headerlink" href="#coredns-setup" title="Permalink to this headline"></a></h3>
<h2 id="kubernetes-install">Kubernetes Install<a class="headerlink" href="#kubernetes-install" title="Permalink to this headline"></a></h2>
<p><strong>This configuration is coming soon.</strong> It will allow you to deploy Netmaker on a Kubernetes cluster.</p>
<h2 id="configuration-reference">Configuration Reference<a class="headerlink" href="#configuration-reference" title="Permalink to this headline"></a></h2>
<p>The “Reference Compose File” (above) explains many of these options. However, it is important to understand fundamentally how Netmaker sets its configuration:</p>
<ol class="arabic simple">
<li><p>Defaults</p></li>
<li><p>Config File</p></li>
<li><p>Environment Variables</p></li>
</ol>
<h3 id="variable-description">Variable Description<a class="headerlink" href="#variable-description" title="Permalink to this headline"></a></h3>
<dl>
<dt>SERVER_HOST:</dt><dd><p><strong>Default:</strong> Server will perform an IP check and set automatically unless explicitly set, or DISABLE_REMOTE_IP_CHECK is set to true, in which case it defaults to 127.0.0.1</p>
<p><strong>Description:</strong> Sets the SERVER_HTTP_HOST and SERVER_GRPC_HOST variables if they are unset. The address where traffic comes in.</p>
</dd>
<dt>SERVER_HTTP_HOST:</dt><dd><p><strong>Default:</strong> Equals SERVER_HOST if set, “127.0.0.1” if SERVER_HOST is unset.</p>
<p><strong>Description:</strong> Set to make the HTTP and GRPC functions available via different interfaces/networks.</p>
</dd>
<dt>SERVER_GRPC_HOST:</dt><dd><p><strong>Default:</strong> Equals SERVER_HOST if set, “127.0.0.1” if SERVER_HOST is unset.</p>
<p><strong>Description:</strong> Set to make the HTTP and GRPC functions available via different interfaces/networks.</p>
</dd>
<dt>API_PORT:</dt><dd><p><strong>Default:</strong> 8081</p>
<p><strong>Description:</strong> The HTTP API port for Netmaker. Used for API calls / communication from front end. If changed, need to change port of BACKEND_URL for netmaker-ui.</p>
</dd>
<dt>GRPC_PORT:</dt><dd><p><strong>Default:</strong> 50051</p>
<p><strong>Description:</strong> The GRPC port for Netmaker. Used for communications from nodes.</p>
</dd>
<dt>MASTER_KEY:</dt><dd><p><strong>Default:</strong> “secretkey”</p>
<p><strong>Description:</strong> The admin master key for accessing the API. Change this in any production installation.</p>
</dd>
<dt>CORS_ALLOWED_ORIGIN:</dt><dd><p><strong>Default:</strong> “*”</p>
<p><strong>Description:</strong> The “allowed origin” for API requests. Change to restrict where API requests can come from.</p>
</dd>
<dt>REST_BACKEND:</dt><dd><p><strong>Default:</strong> “on”</p>
<p><strong>Description:</strong> Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to “off” to turn off.</p>
</dd>
<dt>AGENT_BACKEND:</dt><dd><p><strong>Default:</strong> “on”</p>
<p><strong>Description:</strong> Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to “off” to turn off.</p>
</dd>
<dt>CLIENT_MODE:</dt><dd><p><strong>Default:</strong> “on”</p>
<p><strong>Description:</strong> Enables Client Mode, meaning netclient will be deployed on server and will be manageable from UI. Change to “off” to turn off.</p>
</dd>
<dt>DNS_MODE:</dt><dd><p><strong>Default:</strong> “on”</p>
<p><strong>Description:</strong> Enables DNS Mode, meaning config files will be generated for CoreDNS. Note, turning “off” does not remove CoreDNS. You still need to remove CoreDNS from compose file.</p>
</dd>
<dt>DISABLE_REMOTE_IP_CHECK:</dt><dd><p><strong>Default:</strong> “off”</p>
<p><strong>Description:</strong> If turned “on”, Server will not set Host based on remote IP check. This is already overridden if SERVER_HOST is set. Turned “off” by default.</p>
</dd>
<dt>MONGO_ADMIN:</dt><dd><p><strong>Default:</strong> “mongoadmin”</p>
<p><strong>Description:</strong> Admin user for MongoDB. Change to match above MongoDB instance</p>
</dd>
<dt>MONGO_PASS:</dt><dd><p><strong>Default:</strong> “mongopass”</p>
<p><strong>Description:</strong> Admin password for MongoDB. Change to match above MongoDB instance</p>
</dd>
<dt>MONGO_HOST:</dt><dd><p><strong>Default:</strong> “127.0.0.1”</p>
<p><strong>Description:</strong> Address of MongoDB. Change if necessary.</p>
</dd>
<dt>MONGO_PORT:</dt><dd><p><strong>Default:</strong> “27017”</p>
<p><strong>Description:</strong> Port of MongoDB. Change if necessary.</p>
</dd>
<dt>MONGO_OPTS:</dt><dd><p><strong>Default:</strong> “/?authSource=admin”</p>
<p><strong>Description:</strong> Opts to enable admin login for Mongo.</p>
</dd>
</dl>
<h3 id="config-file-reference">Config File Reference<a class="headerlink" href="#config-file-reference" title="Permalink to this headline"></a></h3>
<p>A config file may be placed under config/environments/&lt;env-name&gt;.yml. To read this file at runtime, provide the environment variable ENV at runtime. For instance, dev.yml paired with ENV=dev. Netmaker will load the specified Config file. This allows you to store and manage configurations for different environments. Below is a reference Config File you may use.</p>
<div class="highlight-YAML notranslate"><div class="highlight"><pre><span></span><span class="nt">server</span><span class="p">:</span>
<span class="nt">apihost</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 127.0.0.1 or remote ip (SERVER_HOST) if DisableRemoteIPCheck is not set to true. SERVER_API_HOST if set</span>
<span class="nt">apiport</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 8081 or HTTP_PORT (if set)</span>
<span class="nt">grpchost</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 127.0.0.1 or remote ip (SERVER_HOST) if DisableRemoteIPCheck is not set to true. SERVER_GRPC_HOST if set.</span>
<span class="nt">grpcport</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 50051 or GRPC_PORT (if set)</span>
<span class="nt">masterkey</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 'secretkey' or MASTER_KEY (if set)</span>
<span class="nt">allowedorigin</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to '*' or CORS_ALLOWED_ORIGIN (if set)</span>
<span class="nt">restbackend</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or REST_BACKEND (if set)</span>
<span class="nt">agentbackend</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or AGENT_BACKEND (if set)</span>
<span class="nt">clientmode</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or CLIENT_MODE (if set)</span>
<span class="nt">dnsmode</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "on" or DNS_MODE (if set)</span>
<span class="nt">disableremoteipcheck</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "false" or DISABLE_REMOTE_IP_CHECK (if set)</span>
<span class="nt">mongoconn</span><span class="p">:</span>
<span class="nt">user</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "mongoadmin" or MONGO_ADMIN (if set)</span>
<span class="nt">pass</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to "mongopass" or MONGO_PASS (if set)</span>
<span class="nt">host</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 127.0.0.1 or MONGO_HOST (if set)</span>
<span class="nt">port</span><span class="p">:</span> <span class="s">""</span> <span class="c1"># defaults to 27017 or MONGO_PORT (if set)</span>
<span class="nt">opts</span><span class="p">:</span> <span class="s">''</span> <span class="c1"># defaults to '/?authSource=admin' or MONGO_OPTS (if set)</span>
</pre></div>
</div>

View file

@ -315,6 +315,27 @@
<a href="quick-start.html#deploy-nodes" class="md-nav__link">Deploy Nodes</a>
</li>
<li class="md-nav__item">
<a href="quick-start.html#manage-nodes" class="md-nav__link">Manage Nodes</a>
</li>
<li class="md-nav__item">
<a href="quick-start.html#uninstalling-the-netclient" class="md-nav__link">Uninstalling the netclient</a>
</li>
<li class="md-nav__item">
<a href="quick-start.html#uninstralling-netmaker" class="md-nav__link">Uninstralling Netmaker</a>
</li></ul>
</li>
@ -669,8 +690,8 @@
<h2 id="contact">Contact<a class="headerlink" href="#contact" title="Permalink to this headline"></a></h2>
<p>If you need help, try the discord or open a GitHub ticket.</p>
<p>Email: <a class="reference external" href="mailto:info%40gravitl.com">info<span>@</span>gravitl<span>.</span>com</a>
Discord: <a class="reference external" href="https://discord.gg/zRb9Vfhk8A">https://discord.gg/zRb9Vfhk8A</a></p>
<p>Email: <a class="reference external" href="mailto:info%40gravitl.com">info<span>@</span>gravitl<span>.</span>com</a></p>
<p>Discord: <a class="reference external" href="https://discord.gg/zRb9Vfhk8A">https://discord.gg/zRb9Vfhk8A</a></p>

View file

@ -18,7 +18,7 @@ Prerequisites
Install
==============
#. ``ssh root@your-host``
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.quick.yml``
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.slim.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
#. ``docker-compose up -d``
@ -133,5 +133,5 @@ Uninstalling the netclient
Uninstralling Netmaker
===========================
To uninstall Netmaker from the server, simply run `docker-compose down`
To uninstall Netmaker from the server, simply run ``docker-compose down`` or ``docker-compose down --volumes`` to remove the docker volumes for a future installation.

View file

@ -1,27 +1,308 @@
============
====================
Server Installation
============
====================
This section outlines installing the Netmaker server, including Netmaker, Netmaker UI, MongoDB, and CoreDNS
Notes on Optional Features
============================
There are a few key options to keep in mind when deploying Netmaker. All of the following options are enabled by default but can be disabled with a single flag at runtime (see Customization). In addition to these options, there are many more Customizable components which will be discussed later on and help to solve for special challenges and use cases.
**Client Mode:** Client Mode enables Netmaker to control the underlying host server's Network. This can make management a bit easier, because Netmaker can be added into networks via a button click in the UI. This is especially useful for things like Gateways, and will open up additional options in future versions, for instance, allowing Netmaker to easily become a relay server.
Client Mode requires many additional privileges on the host machine, since Netmaker needs to control kernel WireGuard. Because of this, if running in Client Mode, you must run with root privileges and mount many system directories to the Netmaker container. Running without Client Mode allows you to install without privilege escalation and increases the number of compatible systems substantially.
**DNS Mode:** DNS Mode enables Netmaker to write configuration files for CoreDNS, which can be set as a DNS Server for nodes. DNS Mode, paired with a CoreDNS deployment, requires use of port 53. On many linux systems (such as Ubuntu), port 53 is already in use to support local DNS, via systemd-resolved. Running in DNS Mode may require making modifications on the host machine.
**Agent Backend:** The Agent Backend is the GRPC server (by default running on port 50051). This port is not needed for the admin server. If your use case requires special access configuration, you can run two Netmaker instances, one for the admin server, and one for node access.
**REST Backend:** Similar to the above, the REST backend runs by default on port 8081, and is used for admin API and UI access. By enabling the REST backend while disabling the Agent backend, you can separate the two functions for more restricted environments.
This document tells you how to install Netmaker.
System Compatibility
====================
Prerequisites
=============
Whether or not you run Netmaker in **Client Mode** is the main determination of system compatibility.
Installing Netmaker
===================
With Client Mode **disabled**, Netmaker can be run on any system that supports Docker. This includes Windows, Mac, Linux, mainframes, and most Unix-based systems. It also requires no special privileges. Netmaker will only need ports for GRPC (50051 by default), the API (8081 by default), and CoreDNS (53, if enabled).
Linux with Docker Compose
-------------------------
With Client Mode **enabled** (the default), Netmaker has the same limitations as the :doc:`netclient <./client-installation>` (client networking agent), because client mode just means that the Netmaker server is also running a netclient.
Linux without Docker
--------------------
This requires privileged (root) access to the host machine and multiple host directory mounts. It also requires WireGuard to be installed, and Linux with systemd installed (see :doc:`compatible systems <./architecture>` for more details).
Kubernetes
----------
To run a non-docker installation, you are running the Netmaker binary, CoreDNS binary, MongoDB, and a web server directly on your host. This requires all the requirements for those individual components. Our guided install assumes systemd-based linux, but there are many other ways to install Netmaker's individual components onto machines that do not support Docker.
Customizing your Installation
-----------------------------
DNS Mode Prereqisite Setup (Ubuntu)
====================================
If you plan on running the
Docker Compose Install
=======================
The most simple (and recommended) way of installing Netmaker is to use one of the provided `Docker Compose files <https://github.com/gravitl/netmaker/tree/feature_v0.3.5_docs/compose>`_. Below are instructions for several different options to install Netmaker via Docker Compose, followed by an annotated reference Docker Compose in case your use case requires additional customization.
Slim Install - No DNS and No Client Mode
--------------------------------------------
This is the same docker compose covered in the :doc:`quick start <./quick-start>`. It requires no special privileges and can run on any system with Docker and Docker Compose. However, it also does not have the full feature set, and lacks Client Mode and DNS Mode.
**Prerequisites:**
* ports 80, 8081, and 50051 are not blocked by firewall
* ports 80, 8081, 50051, and 27017 are not in use
**Notes:**
* You can still run the netclient on the host system even if Client Mode is not enabled. It will just be managed like the netclient on any other nodes, and will not be automatically managed by thhe server/UI.
* You can change the port mappings in the Docker Compose if the listed ports are already in use.
Assuming you have Docker and Docker Compose installed, you can just run the following, replacing **< Insert your-host IP Address Here >** with your host IP (or domain):
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.slim.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
#. ``docker-compose up -d``
Full Install - DNS and Client Mode Enabled
--------------------------------------------
This installation gives you the fully-featured product with Client Mode and DNS Mode.
**Prerequisites:**
* systemd linux (Debian or Ubuntu reccommended)
* sudo privileges
* DNS Mode Prerequisite Setup (see above)
* WireGuard installed
* ports 80, 8081, 53, and 50051 are not blocked by firewall
* ports 80, 8081, 53, 50051, and 27017 are not in use
**Notes:**
* You can change the port mappings in the Docker Compose if the listed ports are already in use.
* You can run CoreDNS on a non-53 port, but this likely will cause issues on the client side (DNS on non-standard port). We do not recommend this and do not cover how to manage running CoreDNS on a different port for clients, which will likely have problems resolving a nameserver on a non-53 port.
Assuming you have Docker and Docker Compose installed, you can just run the following, replacing **< Insert your-host IP Address Here >** with your host IP (or domain):
#. ``sudo su -``
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
#. ``docker-compose up -d``
Server Only Install - UI, DNS, Client Disabled
------------------------------------------------
A "Server Only" install can be helpful for scenarios in which you do not want to run the UI. the UI is not mandatory for running a Netmaker network, but it makes the process easier. This mode also diables DNS and Client Modes, though you can add those back in if needed. There is no UI dependency on Client Mode or DNS Mode.
**Prerequisites:**
* ports 8081 and 50051 are not blocked by firewall
* ports 8081, 50051, and 27017 are not in use
**Notes:**
* You can still run the netclient on the host system even if Client Mode is not enabled. It will just be managed like the netclient on any other nodes, and will not be automatically managed by thhe server/UI.
* You can change the port mappings in the Docker Compose if the listed ports are already in use.
Assuming you have Docker and Docker Compose installed, you can just run the following, replacing **< Insert your-host IP Address Here >** with your host IP (or domain):
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.server-only.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
No DNS - CoreDNS Disabled, Client Enabled
----------------------------------------------
DNS Mode is currently limited to clients that can run resolvectl (systemd-resolved, see :doc:`Architecture docs <./architecture>` for more info). You may wish to disable DNS mode for various reasons. This installation option gives you the full feature set minus CoreDNS.
**Prerequisites:**
* systemd linux (Debian or Ubuntu reccommended)
* sudo privileges
* WireGuard installed
* ports 80, 8081, and 50051 are not blocked by firewall
* ports 80, 8081, 50051, and 27017 are not in use
**Notes:**
* You can change the port mappings in the Docker Compose if the listed ports are already in use.
* If you would like to run DNS Mode, but disable it on some clients, this is also an option. See the :doc:`client installation <./client-installation>` documentation for more details.
Assuming you have Docker and Docker Compose installed, you can just run the following, replacing **< Insert your-host IP Address Here >** with your host IP (or domain):
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.nodns.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
No DNS - CoreDNS Disabled, Client Enabled
No Client - DNS Enabled, Client Disabled
---------------------------------------------
You may want to provide DNS, but do not want to run the server with special privileges, in which case you can run with just Client Mode disabled. It requires no special privileges and can run on any system with Docker and Docker Compose.
**Prerequisites:**
* ports 80, 8081, 53, and 50051 are not blocked by firewall
* ports 80, 8081, 53, 50051, and 27017 are not in use
* DNS Mode Prerequisite Setup (see above)
**Notes:**
* You can still run the netclient on the host system even if Client Mode is not enabled. It will just be managed like the netclient on any other nodes, and will not be automatically managed by thhe server/UI.
* You can change the port mappings in the Docker Compose if the listed ports are already in use.
Assuming you have Docker and Docker Compose installed, you can just run the following, replacing **< Insert your-host IP Address Here >** with your host IP (or domain):
#. ``wget -O docker-compose.yml https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/docker-compose.noclient.yml``
#. ``sed -i s/HOST_IP/< Insert your-host IP Address Here >/g docker-compose.yml``
#. ``docker-compose up -d``
Reference Compose File - Annotated
--------------------------------------
All environment variables and options are enabled in this file. It is the equivalent to running the "full install" from the above section. However, all environment variables are included, and are set to the default values provided by Netmaker (if the environment variable was left unset, it would not change the installation). Comments are added to each option to show how you might use it to modify your installation.
.. literalinclude:: ../compose/docker-compose.reference.yml
:language: YAML
Linux Install without Docker
=============================
Most systems support Docker, but some, such as LXC, do not. In such environments, there are many options for installing Netmaker. Netmaker is available as a binary file, and there is a zip file of the Netmaker UI static HTML on GitHub. Beyond the UI and Server, you need to install MongoDB and CoreDNS (optional).
Below is a guided set of instructions for installing without Docker on Ubuntu 20.04. Depending on your system, the steps may vary.
MongoDB Setup
----------------
1. Install MongoDB on your server:
* For Ubuntu: `sudo apt install -y mongodb`
* For more advanced installation or other operating systems, see the `MongoDB documentation <https://docs.mongodb.com/manual/administration/install-community/>`_.
2. Create a user:
* ``mongo admin``
* > `db.createUser({ user: "mongoadmin" , pwd: "mongopass", roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"]})`
Server Setup
-------------
1. **Run the install script:** ``sudo curl -sfL https://raw.githubusercontent.com/gravitl/netmaker/v0.3.5/scripts/netmaker-server.sh | sh -``
2. Check status: ``sudo journalctl -u netmaker``
3. If any settings are incorrect such as host or mongo credentials, change them under /etc/netmaker/config/environments/< your env >.yaml and then run ``sudo systemctl restart netmaker``
UI Setup
-----------
The following uses NGinx as an http server. You may alternatively use Apache or any other web server that serves static web files.
1. **Download UI asset files:** ``sudo wget -O /usr/share/nginx/html/netmaker-ui.zip https://github.com/gravitl/netmaker-ui/releases/download/latest/netmaker-ui.zip``
2. **Unzip:** ``sudo unzip /usr/share/nginx/html/netmaker-ui.zip -d /usr/share/nginx/html``
3. **Copy Config to Nginx:** ``sudo cp /usr/share/nginx/html/nginx.conf /etc/nginx/conf.d/default.conf``
4. **Modify Default Config Path:** ``sudo sed -i 's/root \/var\/www\/html/root \/usr\/share\/nginx\/html/g' /etc/nginx/sites-available/default``
5. **Change Backend URL:** ``sudo sh -c 'BACKEND_URL=http://<YOUR BACKEND API URL>:PORT /usr/share/nginx/html/generate_config_js.sh >/usr/share/nginx/html/config.js'``
6. **Start Nginx:** ``sudo systemctl start nginx``
CoreDNS Setup
----------------
Kubernetes Install
=======================
**This configuration is coming soon.** It will allow you to deploy Netmaker on a Kubernetes cluster.
Configuration Reference
=========================
The "Reference Compose File" (above) explains many of these options. However, it is important to understand fundamentally how Netmaker sets its configuration:
1. Defaults
2. Config File
3. Environment Variables
Variable Description
----------------------
SERVER_HOST:
**Default:** Server will perform an IP check and set automatically unless explicitly set, or DISABLE_REMOTE_IP_CHECK is set to true, in which case it defaults to 127.0.0.1
**Description:** Sets the SERVER_HTTP_HOST and SERVER_GRPC_HOST variables if they are unset. The address where traffic comes in.
SERVER_HTTP_HOST:
**Default:** Equals SERVER_HOST if set, "127.0.0.1" if SERVER_HOST is unset.
**Description:** Set to make the HTTP and GRPC functions available via different interfaces/networks.
SERVER_GRPC_HOST:
**Default:** Equals SERVER_HOST if set, "127.0.0.1" if SERVER_HOST is unset.
**Description:** Set to make the HTTP and GRPC functions available via different interfaces/networks.
API_PORT:
**Default:** 8081
**Description:** The HTTP API port for Netmaker. Used for API calls / communication from front end. If changed, need to change port of BACKEND_URL for netmaker-ui.
GRPC_PORT:
**Default:** 50051
**Description:** The GRPC port for Netmaker. Used for communications from nodes.
MASTER_KEY:
**Default:** "secretkey"
**Description:** The admin master key for accessing the API. Change this in any production installation.
CORS_ALLOWED_ORIGIN:
**Default:** "*"
**Description:** The "allowed origin" for API requests. Change to restrict where API requests can come from.
REST_BACKEND:
**Default:** "on"
**Description:** Enables the REST backend (API running on API_PORT at SERVER_HTTP_HOST). Change to "off" to turn off.
AGENT_BACKEND:
**Default:** "on"
**Description:** Enables the AGENT backend (GRPC running on GRPC_PORT at SERVER_GRPC_HOST). Change to "off" to turn off.
CLIENT_MODE:
**Default:** "on"
**Description:** Enables Client Mode, meaning netclient will be deployed on server and will be manageable from UI. Change to "off" to turn off.
DNS_MODE:
**Default:** "on"
**Description:** Enables DNS Mode, meaning config files will be generated for CoreDNS. Note, turning "off" does not remove CoreDNS. You still need to remove CoreDNS from compose file.
DISABLE_REMOTE_IP_CHECK:
**Default:** "off"
**Description:** If turned "on", Server will not set Host based on remote IP check. This is already overridden if SERVER_HOST is set. Turned "off" by default.
MONGO_ADMIN:
**Default:** "mongoadmin"
**Description:** Admin user for MongoDB. Change to match above MongoDB instance
MONGO_PASS:
**Default:** "mongopass"
**Description:** Admin password for MongoDB. Change to match above MongoDB instance
MONGO_HOST:
**Default:** "127.0.0.1"
**Description:** Address of MongoDB. Change if necessary.
MONGO_PORT:
**Default:** "27017"
**Description:** Port of MongoDB. Change if necessary.
MONGO_OPTS:
**Default:** "/?authSource=admin"
**Description:** Opts to enable admin login for Mongo.
Config File Reference
----------------------
A config file may be placed under config/environments/<env-name>.yml. To read this file at runtime, provide the environment variable ENV at runtime. For instance, dev.yml paired with ENV=dev. Netmaker will load the specified Config file. This allows you to store and manage configurations for different environments. Below is a reference Config File you may use.
.. literalinclude:: ../config/environments/dev.yaml
:language: YAML

View file

@ -3,11 +3,12 @@ Support
=========
FAQ
=====
----
Contact
========
--------
If you need help, try the discord or open a GitHub ticket.
Email: info@gravitl.com
Discord: https://discord.gg/zRb9Vfhk8A