Giter VIP home page Giter VIP logo

homeserver's Introduction

Dockerized Home-Server with Ansible

Ansible playbook for configuring a dockerized home-server running nextcloud, photoprism, borgbackup, python-telegram-bot, nginx-proxy, acme-companion, binance-trade-bot, watchtower, offlineimap, calcardbackup, and other utilities.

Project image

Overview

This is just a fun project to launch a home-server on an old ThinkPad running Ubuntu Focal Fossa. It should only be used as an inspiration.

The home-server is configured using Ansible and runs (almost) everything using docker-compose.

The Jinja template for the docker-compose file can be found in ansible/roles/docker/templates/docker-compose.yml.j2.

The home-server features:

  • nextcloud with mariadb and redis
  • photoprism with mariadb
  • nginx proxy with acme companion
  • server status using python-telegram-bot
  • binance trading bot with api1
  • automatic backups (borgbackup, rsync, mysqldump, offlineimap, calcardbackup, lftp)
  • automatic updates (watchtower, Ubuntu livepatch, pulling and pruning of docker images)
  • DDNS updater
  • scheduled suspend and wake using rtcwake

Ansible roles

  1. Post-install configuration: The role in ansible/roles/common sets up basic packages, Ubuntu Livepatch, the admin user, SSH, UFW, TLP, systemd, cron, and rtcwake.

  2. Docker-Compose: The role in ansible/roles/docker creates the docker user, installs docker and docker-compose, prepares the docker repos, networks, mounts, cronjobs, and the systemd service. Then it starts and configures the docker-compose services.

How-To

If docker-compose is installed on the controller, one can use the docker-compose.yml specification to set up the home-server as follows:

  1. Create ansible/hosts.yml and ansible/group_vars/all/vault.yml based on ansible/hosts.example.yml and ansible/group_vars/all/vault.example.yml.
  2. Choose a password and encrypt these files: ANSIBLE_VAULT_PASSWORD=ansible_vault_password DOCKER_UID=$(id -g) DOCKER_GID=$(id -u) docker-compose up vault-encrypt
  3. Set up the home-server: ANSIBLE_VAULT_PASSWORD=ansible_vault_password docker-compose up ansible-install

Otherwise, one can also install ansible in a virtual environment and directly start the playbook ansible/site.yml.

Footnotes

  1. While you most likely won't get rich doing this, it serves as a good baseline that can be improved by, e.g., adding sentiment analysis of news feeds and time series forecasting. โ†ฉ

homeserver's People

Contributors

juliusberner avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.