Recently I was having a look to reddit and found this motivating post.

Thanks to the information shared publicaly on the internet, this person was able to use their hobby knowledge for work.

Now I want to share the services that I enjoy using the most as of now.

Hope that it will bring some light to some of you and you can also get into SelfHosting!

And also big thanks to all the people who ever worked on the tools listed here (or make easier for others to use - Few years ago I didnt know any of these!)

Stepping Out From Google Photos

BACK-UP PLEASE!

SelfHosting 101 - Aug 2024

Challenges…a retrospective:

  1. Networking
  2. HD Management
  3. Making the projects work consistently!

This is how I like to start - UI For containers

Name Description License
Heimdall Heimdall, dashboard and launcher for self-hosted services. MIT
YunoHost A server operating system aiming to make self-hosting accessible to everyone. AGPL-3.0
Sandstorm An open-source platform for self-hosting web apps. Apache-2.0
Hestia Control Panel A lightweight and powerful control panel for managing web servers. GPL-3.0

Star History Chart

Get Ready for containers and Manage them with UI and HTTPs ⏬

Get docker:

apt-get update && sudo apt-get upgrade && curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh && docker version

And lets use nginx:

docker volume create nginx_data
docker volume create nginx_letsencrypt
docker network create nginx_default

Like so:

docker run -d \
  --name nginx \
  --network nginx_default \
  --restart unless-stopped \
  -p 80:80 \
  -p 443:443 \
  -p 81:81 \
  -v nginx_data:/data \
  -v nginx_letsencrypt:/etc/letsencrypt \
  jc21/nginx-proxy-manager:latest
docker run -d \
  -p 8000:8000 \
  -p 9000:9000 \
  --name=portainer \
  --network nginx_default \
  --restart=always \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v portainer_data:/data \
  portainer/portainer-ce

Now we have docker, portainer and https ready for any service.

Accesing Services with Tailscale Docker

https://tailscale.com/blog/getting-started-with-docker-and-tailscale?utm_medium=email&_hsmi=318354413&utm_content=318354411&utm_source=hs_email

The easiest, most secure way to use WireGuard and 2FA.

Useful networking CLI’s 📌
ip -4 addr

sudo apt update
sudo apt install net-tools
ifconfig

AI…but Local

Name Short Description License
PrivateGPT A self-hosted and privacy-focused alternative ChatGPT MIT ❤️
Whisper A general-purpose speech recognition model by OpenAI MIT ❤️
GPT4All An open-source assistant-style LLM - Works with Python Apache-2.0 ✅
Netdata Performance and health monitoring tool for your AI Server GPL-3.0 ✅
Local LLMs with Ollama and UI ⏬
version: '3'
services:
  ollama:
    image: ollama/ollama
    container_name: ollama
    ports:
      - "11434:11434"
    volumes:
      - ollama_data:/root/.ollama

  ollama-webui:
    image: ghcr.io/ollama-webui/ollama-webui:main
    container_name: ollama-webui
    ports:
      - "3000:8080" # 3000 is the port that you will access in your browser
    add-host:
      - "host.docker.internal:host-gateway"
    volumes:
      - ollama-webui_data:/app/backend/data
    restart: always
#     networks: ["nginx_default"] #optional

# networks: #optional
#   nginx_default: #optional
#     external: true #optional       

volumes:
  ollama_data:
  ollama-webui_data:
Setup NetData and Monitor your AI Server ⏬
version: '3.8'
services:
  netdata:
    container_name: netdata #v1.45.0
    image: netdata/netdata
    ports:
      - '19999:19999'
    volumes:
      - netdataconfig:/etc/netdata
      - netdatalib:/var/lib/netdata
      - netdatacache:/var/cache/netdata
      - '/etc/passwd:/host/etc/passwd:ro'
      - '/etc/group:/host/etc/group:ro'
      - '/proc:/host/proc:ro'
      - '/sys:/host/sys:ro'
      - '/etc/os-release:/host/etc/os-release:ro'
    restart: unless-stopped
    cap_add:
      - SYS_PTRACE
    security_opt:
      - apparmor=unconfined
    #networks: ["nginx_nginx_network"] #optional 
 
volumes:
  netdataconfig:
  netdatalib:
  netdatacache:

# networks: #optional
#   nginx_nginx_network: #optional
#     external: true #optional

Media Management

P2P Sharing

Feature qBittorrent Transmission
License GPL v2 ✅ GPL v2 or v3 ✅
Platforms Windows, macOS, Linux Windows, macOS, Linux
User Interface Qt-based GUI GTK+ GUI, web UI
Encryption Built-in encryption Requires VPN or proxy
Torrent Creation Supported Not supported
Scripting Not supported Supported

Star History Chart

Replacing The Cloud

Saying bye to cloud syncs - Your media, your Sync:

Syncthing Pros Cons
Open-source, free file synchronization tool MPL v2 ❤️ DIY (?)
Decentralized, P2P architecture No file size limits or storage restrictions 🤘 No built-in backup or version control features
Supports various platforms (Windows, macOS, Linux, Android, etc.) Cross-Arch compatibility x86, arm64, arm32… No official mobile client for iOS 😓
Customizable synchronization settings Flexibility in choosing what to sync Requires all devices to be online for syncing
Syncing your Media and Visualize Photos ⏬

My favourite combo: Filebrowser + Syncthing: admin/admin

---
version: "2.1"
services:
  syncthing:
    image: syncthing/syncthing #ghcr.io/linuxserver/syncthing
    container_name: syncthing
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Rome
    volumes:
      - /home/Docker/Syncthing/config:/config
      - ~/user/Sync-Folder-Data:/data1 #
      - /media/user/TOSHIBA\ EXT/A-SYNC-CLOUD:/data2 #You can add more than one folder, even if different disk
      - /mnt/ext4_drive/Syncthing_Pixel8:/data3 #sudo mount /dev/sda2 /mnt/ext4_drive #when syncing a folder from your phone, choose /data3 in syncthing UI as destination
      #- "C:\\DOCKER\\Syncthing\\config:/config" #Example for Windows
      #- "D:\\Z_Sync:/dataD" ##Example for Windows
    ports:
      - 8384:8384  #UI for Syncthing
      - 22000:22000/tcp
      - 22000:22000/udp
      - 21027:21027/udp
    restart: unless-stopped
#     networks: ["nginx_default"] #optional

  filebrowser:
    image: filebrowser/filebrowser
    container_name: filebrowser
    ports:
      - 8080:80 #UI Filebrowser
    volumes:
      - /home/Docker/FileBrowser/config:/config
      #- /home/Docker/FileBrowser/data:/srv
      #- ~/user/Sync-Folder-Data:/srv #same as Syncthing!
      - /mnt/ext4_drive/Syncthing_Pixel8:/srv #/mnt/usb/Z_BackUP_HD-SDD:/srv
    restart: unless-stopped   
#     networks: ["nginx_default"] #optional

# networks: #optional
#   nginx_default: #optional
#     external: true #optional           

If you are having problems when syncthing the files due to some permissions, you can try debugging with:

sudo chmod 777 /mnt/ext4_drive

And to share individual files with friends, you can try with PicoShare

If your videos are too big…you can try FFShare on Android. I tried it and reduced a 1GB mp4 video to 500mb (and took 5min)

Has Syncthing sent everything it should?

cd /mnt/ext4_drive/Syncthing_Pixel8 #go to your folder
find . -type f -exec du -h {} + | sort -rh | head -n 5 #top5 files by size below my current folder
find . -type f -printf '%T+ %p\n' | sort | head -n 5 #find the top 5 oldest files
find . -type f -printf '%T+ %p\n' | sort -r | head -n 5 #newest
For iOS you can try LocalSend 👇

The file transfer is completely peer-to-peer as well, and even more platforms available:

An open-source cross-platform alternative to AirDrop

Awsome Photo Galleries

But even better with some cool photo gallery…

Here’s a simpler markdown table with one row for each platform, including the license type, one main pro, and one main con:

Platform License Pro Con
PiGallery2 MIT Licensed Web Based. Lightweight and no DB required!. GPX support (and photos are showing in a Map as well) Limited features and customization options.
Piwigo GPL v2 Extensive plugin support and customization. Android App, but not iOS App
Immich aGPL v3 Advanced features like AI-driven face recognition. Android & iOS App Requires 4 containers to setup and more technical knowledge.
Photoview Open Source Modern, user-friendly interface. Basic feature set with limited functionality.
Photo Gallery for your Media: PiGallery… ⏬

We can also use PiGallery: admin/admin

Pros Cons
Lightweight: PiGallery is optimized to be fast, making it ideal for quick setup and use. Limited Features: Compared to other platforms, PiGallery has fewer built-in features and customization options.
Simple Setup: Easy to install and configure, even for users with basic technical skills. No Database: It doesn’t use a database, which might limit scalability for very large collections. No Database!
Modern Interface: Offers a clean and modern user interface that’s easy to navigate. Lack of Plugins: Limited plugin or extension support to add new functionalities.
Mobile Friendly: Responsive design ensures a good experience on mobile devices. Basic Metadata Handling: Only supports basic EXIF data, lacking advanced metadata management.
Open Source: Free and open-source, with a growing community contributing to its development. No Direct Cloud Integration: Lacks direct integration with cloud storage services like Google Drive or Dropbox.

If you are convinced already, just deploy PiGallery with:

version: "3.7"
services:

  pigallery2:
    image: bpatrik/pigallery2:latest #https://github.com/bpatrik/pigallery2
    container_name: pigallery2
    environment:
      - NODE_ENV=production
    volumes:
      - /home/Docker/pigallery/config:/app/data/config
      - /home/Docker/pigallery/tmp:/app/data/tmp
      - db_data:/app/data/db
      - /mnt/ext4_drive/Syncthing_Pixel8:/app/data/images:ro #your images folder
      #- "/mnt/ext4_drive/Syncthing_Pixel8:/app/data/images:ro"
    ports:
      - 8088:80
    restart: unless-stopped

volumes:
  db_data:

Remember, default user and pass for PiGallery2 is: admin/admin

Photo Gallery for your Media: Piwigo… ⏬
version: '3'
services:
  piwigo:
    container_name: piwigo
    image: lscr.io/linuxserver/piwigo:latest #piwigo-docker
    restart: always
    networks:
      - piwigo
    ports:
      - "84:80"
    volumes:
      - /home/Docker/piwigo/config:/config
      - /mnt/ext4_drive/Some/Path/Gallery:/gallery
  piwigodb:
    image: linuxserver/mariadb #supports x86 and ARM64->>https://github.com/xmanyou/piwigo-docker
    restart: always
    container_name: piwigo_mysql
    volumes:
      - /home/Docker/piwigo/db:/var/lib/mysql
    networks:
      - piwigo
    environment: #make sure to change these!!!
      - MYSQL_ROOT_PASSWORD=piwigo
      - MYSQL_PASSWORD=piwigo
      - MYSQL_DATABASE=piwigo
      - MYSQL_USER=piwigo

networks:
  piwigo:

Go to localhost:84 and fill piwigodb as host, and the DB user and pwd as defined in the yml. Also, define the user and pass for the UI.

Photo Gallery for your Media: Immich… ⏬

Thanks to https://linuxiac.com/how-to-install-immich-with-docker/

nano docker-compose.yaml
name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      #start_interval: 30s
      start_period: 5m
    command: ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
    restart: always

volumes:
  model-cache:

And just something more…

nano .env #https://immich.app/docs/install/environment-variables/
# The location where your uploaded files are stored - IMPORTANT!!!
UPLOAD_LOCATION=./library #/mystorage/images
# The location where your database files are stored
DB_DATA_LOCATION=./postgres
# The Immich version to use.
IMMICH_VERSION=release
# PostgreSQL password. Change it to a secure one.
DB_PASSWORD=postgres_pass

# The values below this line do not need to be changed
#######################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Use Immich Web version at: http://localhost:2283

Connect to it from mobile apps with: http://localhost:2283/api

This is it for now regarding your photo’s and so on, but you might be interested to have a look…

Image Tools Description License
DupeGuru Cross-platform tool to find duplicate files BSD 3-Clause ✅
Rembg Remove Photos Background MIT Licensed
FreeFileSync Simple File Sync Tool
UpScayl Free and Open Source AI Image Upscaler for Linux, MacOS and Windows. aGPL v3 ✅

Time to Relax

Jellyfin with Metube ⏬
version: '3.8'

services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin
    container_name: jellyfin
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Rome
    ports:
      - "8096:8096"
    volumes:
      - "/home/youruser/Docker/Jellyfin:/config" #change it
      - "/home/youruser/Downloads:/data" #change it

  metube:
    image: ghcr.io/alexta69/metube
    container_name: metube
    restart: unless-stopped
    ports:
      - "8081:8081"
    volumes:
      - "/home/youruser/Downloads:/downloads"

Once completed, you will have localhost:8096 the UI for jellyfin:

jellyfin

Name Short Description License
yt-dlp A feature-rich command-line audio/video downloader Unlicense
YoutubeDownloader Downloads videos and playlists from YouTube MIT
ytdl-sub Lightweight tool to automate downloading and metadata generation with yt-dlp GPL-3.0
youtube_downloader A simple youtube / shorts video downloader app. Use it at HF Apache-2.0
Interesting Dev Tools to for YT ⏬
Name Short Description License
Whoogle Search A self-hosted, ad-free, privacy-respecting metasearch engine MIT
SearXNG A free internet metasearch engine which aggregates results from various search services and databases AGPL-3.0
AI Search Tools Morphic, Perplexica, LLocalSearch… I need to try them!
Quick Setup to Local Search ⏬
version: "3.7"

services:
  searxng:
    image: searxng/searxng
    container_name: searxng
    ports:
      #- "${PORT}:8080"
      - "3003:8080"
    volumes:
      #- "${PWD}/searxng:/etc/searxng"
      - "/home/Docker/searxng:/etc/searxng"
    environment:
      #- BASE_URL=http://localhost:$PORT/
      - BASE_URL=http://localhost:3003/
      - INSTANCE_NAME=my-SearXNG-instance
      #- FORMAT=html json
  
  whoogle:
    image: benbusby/whoogle-search:latest
    container_name: whoogle
    ports:
      - 5000:5000 #accessible through the port 5000
    restart: unless-stopped
    networks: ["nginx_default"]


networks:
    nginx_default:
        external: true

You will have SearXNG ready at: localhost:3003

TBC - Need to try (AI) ⏬

Monitoring

Name Short Description License
Speedtest Tracker A self-hosted internet speed tracking tool with a web UI MIT ❤️
WatchYourLAN A tool to monitor devices in your local network MIT ❤️
Uptime Kuma A self-hosted monitoring tool like “Uptime Robot” MIT ❤️
MySpeed Speed test analysis software that shows your internet speed for up to 30 days MIT ❤️
statping-ng A Status Page for monitoring your websites and applications with beautiful graphs, analytics, and plugins. GPL 3.0
Self-hosted Internet and Service Monitoring: UptimeKuma, SpeedTest-Tracker, OpenSpeedTest and MySpeed ⏬
docker run -it -p 8080:8080 adamboutcher/statping-ng #it also requires a DB
version: '3.3'
services:
  uptimekuma:
    container_name: uptimekuma
    image: 'louislam/uptime-kuma:1'
    ports:
      - '3001:3001'
    volumes:
      - /home/user_name/Docker/uptime-kuma/data:/app/data
    restart: unless-stopped
#     networks:
#       - cloudflare_tunnel
#       - nginx_default
            
    speedtest-tracker:
        image: ghcr.io/alexjustesen/speedtest-tracker:latest    
        container_name: speedtest-tracker
        ports:
            - 6050:80
            - 6443:443
        networks: ["nginx_nginx_network"]       
        # networks:
        #        nginx_nginx_network:   
        environment:
            - PUID=1000
            - PGID=1000
        volumes:
            - /home/Docker/speedtest:/config
        restart: unless-stopped


  openspeedtest:
    image: openspeedtest/latest
    container_name: openspeedtest
    ports:
      - "6040:3000" # THIS IS THE UI FOR OPENSPEEDTEST
      - "6041:3001"
    networks: #optional
      nginx_nginx_network:      #optional
    restart: unless-stopped

  myspeed:
    container_name: MySpeed
    image: 'germannewsmaker/myspeed'
    restart: unless-stopped
    ports:
      - '5216:5216'
    volumes:
      - data:/myspeed/data
volumes:
  data:    

networks:
  nginx_nginx_network:
    external: true

Productivity

Name Short Description License
Webtops A web-based desktop environment that runs in your browser MIT
Timelite A self-hosted time tracking tool with a simple and intuitive interface GPL-3.0
Leantime A self-hosted project management and collaboration tool GPL-2.0
Logseq A privacy-first knowledge base and note-taking app - Integrates with Ollama AGPL-3.0
Docker Stack for these productivity Tools 👇

---
version: "2.1"
services:
  webtop:
    image: lscr.io/linuxserver/webtop:ubuntu-kde #latest #choose the one you want
    container_name: webtop3
    security_opt:
      - seccomp:unconfined #optional
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - SUBFOLDER=/ #optional
      - TITLE=Webtop #optional
    volumes:
      - /home/Docker/webtop3:/config
      - /var/run/docker.sock:/var/run/docker.sock #optional
    ports:
      - 2003:3000
      - 2033:3001
    devices:
      - /dev/dri:/dev/dri #optional
    shm_size: "2gb" #optional
    restart: unless-stopped
    networks:  #optional
      nginx_nginx_network:       #optional

  logseq:
    image: ghcr.io/logseq/logseq-webapp:latest
    ports:
      - "3000:3000"  # Expose Logseq on port 3000
    environment:
      - LOGSEQ_SERVER_PORT=3000  # Set the Logseq server port
    restart: unless-stopped
    # volumes:
      # - logseq_data:/path/to/data  # Uncomment and set the path if you need persistent storage

# Uncomment the following lines if you need persistent storage
# volumes:
  # logseq_data:

  timelite:
    container_name: timelite
    build: .
    env_file: .env
    ports:
      - "${PORT}:${PORT}"
    command: yarn next:start
    restart: unless-stopped

    db_leantime:
        ports:
          - '3306:3306'
        networks: 
          - leantime-net
        volumes:
          - ~/Docker/Leantime/db:/var/lib/mysql
        environment:
          - MYSQL_ROOT_PASSWORD=321.qwerty
          - MYSQL_DATABASE=leantime
          - MYSQL_USER=admin
          - MYSQL_PASSWORD=321.qwerty
        container_name: leantime_db
        image: linuxserver/mariadb                    #it will work for ARM or X86 ('mysql:5.7' only x86)
        restart: always
    leantime:
        ports:
            - '8483:80'
        networks: 
          - leantime-net
        volumes:
          - ~/Docker/Leantime/public:/var/www/html/public/userfiles
          - ~/Docker/Leantime:/var/www/html/userfiles          
        environment:
            - LEAN_DB_HOST=db_leantime
            - LEAN_DB_USER=admin
            - LEAN_DB_PASSWORD=321.qwerty
            - LEAN_DB_DATABASE=leantime          
        container_name: leantime
        image: 'leantime/leantime:latest'
        restart: always

networks:  #optional
  nginx_nginx_network:  #optional
    external: true         #optional
  leantime-net:
    external: false

That’s all for now - Happy SelfHosting!

Conclusion

Connecting Safely to your Services

Here’s a simplified markdown table with one row for each service, summarizing key aspects:

Service License Primary Use Pro Con
Pi-hole Open Source (GPLv3) Network-wide ad blocking Comprehensive ad and tracker blocking Requires a web server setup
Blocky Apache v2 DNS filtering and ad blocking Customizable DNS filtering May require DNS server configuration
Unbound Open Source (Unlicense / BSD-like) DNS resolving High-performance DNS resolver No built-in ad-blocking capabilities
DnsServer GPLv3

More Privacy Resources here - https://github.com/Lissy93/awesome-privacy

And a awsome post (and blog) about being add free in android with PiHole over DOT by romailler

Tools for Easy Connection

Install Remina / VNC 👇

Remina:

sudo apt update
sudo apt install remmina
sudo apt install remmina-plugin-rdp remmina-plugin-vnc remmina-plugin-ssh

VNC Server:

sudo apt update
sudo apt install tigervnc-standalone-server tigervnc-common
vncserver #You will be prompted to set a password and configure the VNC server for the first time.
#vncserver -kill :1

VNC Viewer:

sudo apt update
sudo apt install tigervnc-viewer
Install RustDesk 👇
sudo apt install flatpak
flatpak --version
#flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

wget https://github.com/rustdesk/rustdesk/releases/download/1.2.3-1/rustdesk-1.2.3-x86_64.flatpak
flatpak install rustdesk-1.2.3-x86_64.flatpak

flatpak run com.rustdesk.RustDesk

No BackUp = No Mercy

Fast, secure, efficient backup program

Save your dotfiles once, deploy them everywhere

  • Duplicati
---
version: "2.1" #https://github.com/duplicati/duplicati?tab=License-1-ov-file#readme
services:
  duplicati:
    image: lscr.io/linuxserver/duplicati #ghcr.io/linuxserver/duplicati #:arm32v7-v2.0.6.1-2.0.6.1_beta_2021-05-03-ls101
    container_name: duplicati
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Madrid
      - CLI_ARGS= #optional
    volumes:
    - /home/your_user_name/Docker/Duplicati/config:/config
    - ~/Docker:/source
    - ~/Docker/backups:/backups
    ports:
      - 8200:8200
    restart: unless-stopped

What’s next for me…

I definitely want to have a look to…

version: '3.9'
services:
    it-tools:
        image: 'corentinth/it-tools:latest'
        ports:
            - '8035:80'
        restart: unless-stopped
        container_name: it-tools

https://www.youtube.com/watch?v=Mebe5-plYfE

IT-Tools: Your New Open-Source Developer Toolkit With Over 80 Apps!

It helps you manage your servers, applications, and databases on your own hardware; you only need an SSH connection. You can manage VPS, Bare Metal, Raspberry PIs, and anything else.

An open-source & self-hostable Heroku / Netlify / Vercel alternative.

A project that makes easy the initial setup of a Home Server.

Deploy Cosmos with Docker and forget about ‘The Cloud’ ⏬
version: '3'
services:
  cosmos-server:
    image: azukaar/cosmos-server:latest
    container_name: cosmos-server
    hostname: cosmos-server
    privileged: true
    restart: always
    ports:
      - "800:80"
      - "4433:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /:/mnt/host
      - /var/lib/cosmos:/config
    networks:
      - default

networks:
  default:

Thanks To

  • Youtube: DBTech,
  • Webs: noted.lol,

FAQ

OS for SelfHosting

Name Description License
CasaOS A simple, easy-to-use, and elegant open-source Home Cloud system. Apache-2.0
Raspbian OS A simple, easy-to-use, and elegant open-source Home Cloud system. Apache-2.0
Ubuntu A simple, easy-to-use, and elegant open-source Home Cloud system. Apache-2.0
HomeAssistant OS A simple, easy-to-use, and elegant open-source Home Cloud system. Apache-2.0
Why CasaOS 👇
  • Community-based open source software focused on delivering simple personal cloud experience around Docker ecosystem.
  • CasaOS fully supports ZimaBoard, Intel NUC, and Raspberry Pi. Also, more computers and development boards with the following architectures: amd64, armv7, arm64.
  • CasaOS is fully compatible with Ubuntu, Debian, Raspberry Pi OS, and CentOS with one-liner installation. Not sure about your compatibility? Check out the
  • CasaOS is fully compatible with the Docker container ecosystem, with a huge number of Apps to choose from.

HD Management for SelfHosting

df -h #these are the ones mounted

lsblk -f #will list all the connected devices and their disk format

alias disksummary="df -h | grep '^/dev' | awk '{print \$1, \$4, \$2, \$5}'" #list only disks summary
disksummary #then call it as simple as this!

Are missing space? - try this to remove cache:

docker builder prune
#docker system prune -a
docker volume prune
docker image prune -a

This command lists all block devices (like hard drives and USB drives) in a tree format:

lsblk #list them again
And you can do automatic mount points with it ⏬

I was tired of having to mount the disks after every reboot and found this as the best solution:

sudo parted /dev/sda1 print
lsblk -f /dev/sdb2 /dev/sda1 #see the format and the UUID of a couple of blocks
df -h /dev/sda1 #you will see if its mounted

To mount a partition you can always do:

sudo mkdir /mnt/data_mounted \
mount -t ntfs /dev/sdb1 /mnt/data_mounted/ #example with ntfs

Or to just do it once and forget about it…

#sudo /mnt/ext4_mount_point_folder
sudo nano /etc/fstab

#<device> <mountpoint> <filesystem> <mount options> <dump> <pass>
UUID=some-uuid-of-your-drive /mnt/ext4_mount_point_folder ext4 defaults 0 1

You might need to install support for NTFS format for linux (but they can work):

#sudo apt update
#sudo apt install ntfs-3g
#sudo mkdir /mnt/ntfs_drive

#mount
sudo ntfs-3g /dev/sda1 /mnt/ntfs_drive
lsblk -f

An interesting format for storing data in linux might be EXT4

Feature ext4 NTFS
Operating System Compatibility Linux, some Unix-like systems Windows, can be read-only on macOS and Linux
Maximum File Size 16 TiB 16 EiB (theoretical)
Maximum Volume Size 1 EiB 256 TiB
File Permissions POSIX-compliant permissions (user, group, others) Access Control Lists (ACLs)
Encryption No built-in support (requires additional tools like eCryptfs or LUKS) Built-in support (Encrypting File System - EFS)
File System Check fsck utility for checking and repairing chkdsk utility for checking and repairing
Open Source Yes No (proprietary)

How to BenchMark your Server

See what hardware you have 👇

This is what we got!

lscpu

Let’s benchmark it:

sudo apt install sysbench 
sysbench cpu --threads=4 run #https://github.com/akopytov/sysbench#general-command-line-options
  1. Sysbench
  2. Phoronix
  3. Real Test! Let’s build something

The Phoronix Test Suite open-source, cross-platform automated testing/benchmarking software.

How to use Phoronix 👇
wget https://github.com/phoronix-test-suite/phoronix-test-suite/releases/download/v10.8.4/phoronix-test-suite_10.8.4_all.deb
sudo dpkg -i phoronix-test-suite_10.8.4_all.deb
sudo apt-get install -f

And benchmark as simple as:

phoronix-test-suite benchmark smallpt
#phoronix-test-suite system-info

You can also build something, like the Astral Python PKG Manager…

…and see how much time it takes to build it 👇
apt install cargo
time cargo install --git https://github.com/astral-sh/rye rye
#cargo install --git https://github.com/astral-sh/rye --rev ab5baa02580117358e097a91263bde011ff10d68 rye #at this point https://github.com/astral-sh/rye/commit/ab5baa02580117358e097a91263bde011ff10d68
Name Description License
Sysbench Modular, cross-platform, and multi-threaded benchmark tool for evaluating OS parameters, CPU, memory, file I/O, and database performance. GPL-2.0
Phoronix Test Suite Comprehensive testing and benchmarking platform for Linux, macOS, Windows, Solaris, and BSD operating systems. GPL-3.0
fio (Flexible I/O Tester) I/O tool for benchmark and stress/hardware verification, supporting various I/O engines and I/O priorities. GPL-2.0
Geekbench Cross-platform benchmark that measures CPU, GPU, and memory performance, with a focus on real-world scenarios. Geekbench EULA (Free for personal use)
7-Zip Benchmark Built-in benchmark feature in the 7-Zip file archiver that measures CPU performance. GNU LGPL
Stress-ng Stress test and benchmark tool for various subsystems, including CPU, memory, I/O, and more. GPL-2.0

How to Secure Your Server

Use Fail2Ban 🐋 Container with NGINX 👇
version: '2'
services:
  fail2ban:
    image: crazymax/fail2ban:latest
    restart: unless-stopped
    network_mode: "host"
    cap_add:
    - NET_ADMIN
    - NET_RAW
    volumes:
    - /var/log:/var/log:ro
    - ~/Docker/fail2ban/data:/data
    env_file:
      - ./fail2ban.env