Repository containing the docker-compose setup for my NAS / homeserver
- Nextcloud for convenient cloud storage
- Home Assistant for home automation and control
- Plex for movies and shows
- Nginx Proxy with Let's Encrypt for secure external access
- HackMD for easy note-taking via Markdown
- Gitea as GIT hosting / mirroring for some of my repositories
- InvoiceNinja for custom invoicing
You need to have the following environment variables setup or replaced in your docker-compose.yml
and your storage mounted in /mnt/storage/cloud
and /mnt/storage/shares
for nextcloud and plex respectively.
example /etc/environment
DOCKER_USER_ID=1002
DOCKER_USER_GROUP_ID=1002
TIMEZONE=Europe/Berlin
STORAGE_PATH=/mnt/storage
[email protected]
PLEX_HOSTNAME=nas
PLEX_ADVERTISE_IP=http://<IP of your nas here>:32400/
PLEX_VIRTUAL_HOST=plex.example.com
NEXTCLOUD_VIRTUAL_HOST=cloud.example.com
NEXTCLOUD_MYSQL_ROOT_PASSWORD=yourRootPasswordHere
NEXTCLOUD_MYSQL_PASSWORD=yourPasswordHere
KIBANA_VIRTUAL_HOST=kibana.example.com
HOME_ASSISTANT_VIRTUAL_HOST=hass.example.com
HACKMD_VIRTUAL_HOST=hackmd.example.com
HACKMD_POSTGRES_PASSWORD=yourPasswordHere
GITEA_VIRTUAL_HOST=git.example.com
GITEA_MYSQL_ROOT_PASSWORD=yourRootPasswordHere
GITEA_MYSQL_PASSWORD=yourPasswordHere
INVOICENINJA_VIRTUAL_HOST=invoice.example.com
INVOICENINJA_APP_KEY=yourAppKeyHere
INVOICENINJA_MYSQL_ROOT_PASSWORD=yourRootPasswordHere
INVOICENINJA_MYSQL_PASSWORD=yourPasswordHere
INVOICENINJA_MAIL_HOST=smtp.example.com
[email protected]
INVOICENINJA_MAIL_PASSWORD=yourPasswordHere
INVOICENINJA_MAIL_FROM_NAME=Your Name
[email protected]
PYLOAD_VIRTUAL_HOST=downloads.example.com
(you need to have correct DNS records set for the domains you want to use and probably setup port forwarding of ports 80 and 443 to your nas in order to get remote access and let's encrypt working)
- Make sure to have
docker
anddocker-compose
installed on your system. - You also need to have some sort of dynamic DNS setup to your (public) IP. Point the Domain(s) you are using to this IP.
- Add a static rule to your router for the system you are running this on, so the (private) IP doesn't change. Then forward ports
80
and `443 to this IP - Clone the repo to
/opt
- Run
docker-compose -f /opt/docker-compose.yml up -d
- Services should be available at the hosts specified in your environment.
As I wanted to have certain directories directly accessible in my network, I created a user shareuser
, which owns the shared dir and used the following config for /etc/samba/smb.conf
:
[global]
workgroup = WORKGROUP
server string = nas
security = user
guest ok = yes
map to guest = Bad Password
log file = /var/log/samba/%m.log
max log size = 50
printcap name = /dev/null
load printers = no
# Samba Shares
[nas]
comment = Storage on NAS
path = /mnt/storage/shares
browseable = yes
public = yes
writeable = yes
create mask = 0644
directory mask = 0755
force user = shareuser
You will need to restart samba for config changes to take effect