Skip to main content

Env Setup

Heads Up!

Each compose-file has its own .env file associated with it for modularity. Since there are a lot of different ways to spin up your environment, you can either copy the parts you want from this project and use them individually, or use the project as is, which you can do in an incremental way.

  • Do this to create your .env files:
./scripts/copyenv.sh

You will need to adjust the newly created .env file with values specific to your machine. These values are marked with a comment #CHANGE_ME - there may be a lot more you need to change but the project will spin up as-is. (Like credentials or small config options)

Literally everything in the docker compose files are variablized as much as possible so all you have to change is the associated .env variable.

root .env file explained
## CONTAINER  DATA LOCATION
# This will place the container data in the current repo location.
# You can change this and all data will be placed in that location.
DEFAULT_CONTAINER_DATA_LOCATION="../../.containers" #CHANGE_ME if you want to house your data elsewhere outside of this project directory e.g. a network volume /media/my-network-smb/container-data
PROJECT_HOSTNAME="localhost" #CHANGE_ME if you are hosting outside of your local machine

#### TRAEFIK and AUTHENTIK GLOBALS
CF_API_EMAIL="" #CHANGE_ME
CF_DNS_API_TOKEN="" #CHANGE_ME
ACME_DNS_CHALLENGE_PROVIDER="cloudflare" #CHANGE_ME
TRAEFIK_TLS_CERTRESOLVER="cloudflare" #CHANGE_ME
TRAEFIK_DASHBOARD_CREDENTIALS=admin:$$2y$$05$$cqTXRio8juH740Wo7m4y5OWFbQKB0eTaHexKPYmssn4qctTe8ElQe #CHANGE_ME
TRAEFIK_NETLIFY_TOKEN="asdfasdfasdfasdfasdfasdfasdfasdf" #CHANGE_ME

## COMPOSE_PROFILES ---- Use this variable to select which containers you would like to spin up.
## Or you can just pass "all" into the variable and it will spin up everything (except the media server, that requires you to pass it in yourself)
# COMPOSE_PROFILES=all

## or all with media server
# COMPOSE_PROFILES=all,jellyfin

## Or just individually comma separate your services.
COMPOSE_PROFILES=bookstack,dashy,duplicati,jellyseerr,komga,pihole,portainer,prowlarr,radarr,sonarr,transmission,vpn,jellyfin,homeassistant,zwavejs,zigbee2mqtt,mealie

### ENABLE TRAEFIK - keep COMPOSE_PROFILES above
COMPOSE_PROFILES=${COMPOSE_PROFILES},traefik ## Not required but recommeneded for reverse proxy

### ENABLE AUTHENTIK - keep COMPOSE_PROFILES above and Traefik
# COMPOSE_PROFILES=${COMPOSE_PROFILES},authentik

## OPTIONS ---- bookstack,dashy,duplicati,jellyseerr,komga,pihole,portainer,prowlarr,radarr,sonarr,transmission,vpn
## MORE OPTIONS- jellyfin,emby,plex,homeassistant,zwavejs,zigbee2mqtt,homeAutomation,all

############################################
########## CONTAINER NAMES #################
############################################

## User Host Machine - unix machines can find this by doing `id <username>`
UID="1000" #CHANGE_ME
GID="1000" #CHANGE_ME
TIMEZONE="America/Chicago" #CHANGE_ME - This is Central Time Zone by default

## Local Paths
LOCAL_MOVIES_PATH="/Volumes/Movies" #CHANGE_ME
LOCAL_TV_PATH="/Volumes/Television" #CHANGE_ME
LOCAL_BOOKS_PATH="/Volumes/Books" #CHANGE_ME
LOCAL_DOWNLOADS_PATH="/Volumes/Downloads" #CHANGE_ME
LOCAL_BACKUPS_PATH="/Volumes/Backups" #CHANGE_ME

## Samba
SMB_USER="samba" #CHANGE_ME
SMB_PASS="test" #CHANGE_ME

## unix machines can find this by doing `id <username>` for the desired user's id on that machine
SMB_UID="12312" #CHANGE_ME
SMB_GID="123123" #CHANGE_ME

## Network Paths
MOVIE_NETWORK_SHARE="//IP.IP.IP.IP/SHARENAME" #CHANGE_ME
TV_NETWORK_SHARE="//IP.IP.IP.IP/SHARENAME" #CHANGE_ME

PIHOLE_NETWORK_GATEWAY="192.168.1.1" #CHANGE_ME
PIHOLE_NETWORK_ADDRESS_POOL="192.168.1.0/24" #CHANGE_ME
PIHOLE_NETWORK_INTERFACE="eth0" #CHANGE_ME

DUPLICATI_HOST_PORT="8200"
TRANSMISSION_HOST_PORT="9091"
TRANSMISSION_SEED_DISCOVERY_PORT_TCP="51413"
TRANSMISSION_SEED_DISCOVERY_PORT_UDP="51413"

Default Container Location

The default location where all container data is persisted is in ./.containers/* this is in the project directory. You can change this easily to point at your own home directory if you would like it more easily accessible.

Compose Profiles

This is an interesting feature in docker that allows this project to essentially work with feature flags.

COMPOSE_PROFILES=...

Doing this allows you to enable whatever services you would like to run in the setup down to the most granular level. This variable is set when the helper-scripts are run as well. This allows you to make minimal changes to the yaml files themselves and only make .env changes.

See Docker Info for more information regarding including other services.

Specific Compose Project Info .env

Nord VPN Variables

Private Key / TOKEN

Important!

Token and subscription to NordVPN Is needed to use this. See here for configuring/retrieving your TOKEN in Linux.

This is required to run Nord VPN. Without it, the vpn will not start up or be linked to an account.

IP Configuration

VPN_DNS="8.8.8.8,8.8.4.4" #CHANGE_ME - this is google's DNS if that works for you
VPN_ALLOWED_IPS="0.0.0.0/0" #CHANGE_ME - this allows all IPs
VPN_NET_LOCAL="172.16.0.0/12,192.168.0.0/16" #CHANGE_ME if your network doesn't fit this schema
  • The VPN_ALLOWED_IPS is just a filler - this allows all IPs to connect to your instance. Configure this with a proper subnet here with allowed hosts to connect.
  • The VPN_NET_LOCAL - These are local IP Addresses. This should work for most home networks. This is a comma-separated list of IP addresses with allowed CIDR ranges.

UID/GID

This is specific to your host machine's user ID and group ID. If you run on a Unix based system then you can find these values for a user by doing the following:

id <username>

Mount the drives you want on your host machine and have them setup to connect on boot. Then reference those paths in your variables. Comment out what you don't need.

Pro Tip

Doing it this way vs the network route ensures that the network paths are connected via your host machine. Docker networking can be a pain, so local is recommended. However, if you want to use Samba shares, you can, just be prepared to change the docker-compose file a lot.

Using local also has way less headaches if you are unfamiliar with docker's volume setup.

Emby and Jellyfin can also do realtime monitoring, but they do not work with Network shares! If you mount the network share on your host machine and then make it local to the container, it doesn't know the difference! You can have realtime monitoring without having to deal with network shares in the docker container!

These are examples using network shares mounted locally on my own Macbook setup:

## Local Paths
LOCAL_MOVIES_PATH="/Volumes/Movies" #CHANGE_ME
LOCAL_TV_PATH="/Volumes/Television" #CHANGE_ME
LOCAL_BOOKS_PATH="/Volumes/Books" #CHANGE_ME
LOCAL_DOWNLOADS_PATH="/Volumes/Downloads" #CHANGE_ME

Samba

SMB (Samba) Shares User and Pass

This is specifically for mounting network shares. If you do not need this (i.e. if the host machine mounts the drives before docker spins up) then you can comment them out.

SMB UID and GID

This may or may not be the same as the UID and GID above. For that reason I have separated it into different variables (if you needed to have only readonly access for a user or something).

Network Shares

These are the IP Addresses and share names related to the network shares that you would like to mount as SMB shares.

Jellyseer

Change this to be either jellyfin, emby, or plex

JELLYSEER_TYPE="jellyfin" #CHANGE_ME - based on what you decide for media server

Transmission

The username and password is here in the env file. Please do change this and document it.

## TRANSMISSION
TRANSMISSION_USER="transmission" #CHANGE_ME
TRANSMISSION_PASS="noissimsnart" #CHANGE_ME

Dashy

This is where the default configuration that ships with this project is based. This location can be changed if you would like to create a new config file, or would like to import someone else's.

DASHY_CONFIG_LOCATION="./dashy-config.yml"

Pihole

The PiHole web password is defined here. Please change this from the default.

PIHOLE_SECURE_WEB_PASSWORD="pihole"

ZWave JS and Zigbee2MQTT

If you decide to use ZWaveJS and Home Assistant, you will need to setup the USB dongle for the zwave network to function:

ZWAVE_STICK_DEVICE_PATH="/path/to/usb" #CHANGE_ME
ZIGBEE_STICK_DEVICE_PATH="/path/to/usb" #CHANGE_ME