SelfHosting

You can do it with a Raspberry Pi, with and old laptop, in the cloud…

But you can even do it in the very same computer you are reading this.

  1. Get Docker/Podman installed
  2. Get the Docker-Compose ready
  3. Deploy!
Follow these CLI’s! πŸš€
sudo apt update
sudo apt install openssh-server
#systemctl status ssh

sudo ufw allow ssh

#ssh username@<local_minipc_server_ip>

Check processes with:

#systemctl status
htop

#systemctl list-units --type=service
systemctl list-units --type=service --state=running

And the ports used:

sudo lsof -i -P -n

Follow the steps of this SelfHosting-101 script:

curl -O https://raw.githubusercontent.com/JAlcocerT/Linux/main/Z_Linux_Installations_101/Selfhosting_101.sh
#nano Selfhosting_101.sh #MAKE SURE YOU UNDERSTAND WHAT YOU WILL BE RUNNING

chmod +x Selfhosting_101.sh
sudo ./Selfhosting_101.sh

Remember to go to your Portainer instance and setup the user/pass: localhost:9000

If you forget, you will need to restart Portainer:

docker restart portainer

Analytical Tools

GenAI

You can also try with

python -m venv your-env #(create a virtual environment)
source your-env/bin/activate #(or on Windows your-env\Scripts\activate) (activatea the venv)
#deactivate
conda create -n yourcondaenvironment python=3.11
conda activate yourcondaenvironment
conda deactivate

LLMs

  • Ollama
ℹ️
The ML Compilation for LLMs project aims to spread the development and deployment of AI Models.
https://flathub.org/apps/com.cassidyjames.butler #HA visualizer

This repo contains interesting projects (π—Ÿπ—Ÿπ— π˜€, π—Ÿπ—Ÿπ— π—’π—½π˜€, and π˜ƒπ—²π—°π˜π—Όπ—Ώ π——π—•π˜€) to have a look: https://github.com/iusztinpaul/hands-on-llms

Text-to-Image

  • Automatic111
  • Fooocus

Voice to Text

Affordable Local Gen AI with iGPU’s

Thanks to to Tech-Practice for inspiration.

Productivity

  • Cal

    • Together with a caldav / Stripe / Signal / Matrix / Web Analytics / …
    • It admits webhooks
  • Chatwoot

    • Also allows webhooks
  • Only Office Server


Communication

You can connect to Matrix with Thunderbird as well.


Media

Quick seedbox: Torrents + Mullvad -> Syncthing/Filebrowser

Decentralized Storage

  • Centralization -> Simplicity and Single Point of Failure

  • Some alternatives:

    • IPFS - an open system to manage data without a central server
    • Filecoin - an open-source cloud storage marketplace, protocol, and incentive layer.

Great intro video from Naomi on Decentralized Storage

Metube + JDownloader + Navidrome

How to Back Up my Server?

Duplicati to other location (HD / Mega, One drive, s3…)

Windows inside Docker

Thanks to the Dockur Project and by using the Image

With this Docker-Compose πŸ‘ˆ
version: '3.3'

services:
  windows:
    image: dockurr/windows
    container_name: windows
    devices:
      - /dev/kvm
    cap_add:
      - NET_ADMIN
    ports:
      - "8006:8006" #UI
      - "3389:3389/tcp"
      - "3389:3389/udp"
    stop_grace_period: 2m
    restart: on-failure
    volumes:
      - ./data:/storage
    environment:
      RAM_SIZE: 8GB
      CPU_CORES: 3
      DISK_SIZE: 75GB
      VERSION: "win10"

FAQ

Where to Learn More about SelfHosting?

How to Secure my Services?

What about Web Assembly?

With WASM we can run Apps coded in other language (other than web language like js) in our browsers.

WASM allow us to compiled code and run it in various environments (for example browsers) - Regardless of OS and even architecture ARM/X86/RISC-V…

With Docker we have (generally) bigger Images than WASM. Wasm follows both OCI and w3c standards.

graph TD;
    WASM_Module_1(".WASM Module 1,2,3...") -->|WA| WASM_Runtime("WASM Runtime (wasmtime, wamr, wagi)");
    WASM_Runtime -->|WASI - Web Assembly Interface| Host_OS("Host OS");

Thanks to DevOps Toolkit

Get Started with WASM 🐰

Install emcc:

git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest

./emsdk activate latest
source ./emsdk_env.sh

This compiles the C to —> html, js, wasm (this is our WASM Module)

#emcc helloworld.c -o helloworld.html
emcc -o hello.html hello.c

See what was created:

python3 -m http.server 8080 #choose any port

To run wasm inside docker: you need to enable it as Beta feature at this time of writing

sudo apt-get install ./docker-desktop-4.27.2-amd64.deb
#settings -> features in development -> Enable WASM

Now instead of compiling the html or js app, we will just compile the .wasm module:

emcc -o hello.wasm hello.c

#ll hello.wasm
#file hello.wasm

Create your DockerfileWasm

FROM scratch

COPY helloworld.wasm /helloworld.wasm
ENTRYPOINT [ "/helloworld.wasm" ]

Build your WASM Image

docker buildx build --platform wasi/wasm -t fossengineer/helloworld-wasm -f DockerfileWasm .
#docker image ls | head

Run WASM with Docker:

docker run --platform wasi/wasm --runtime io.containerd.wasmedge.v1 fossengineer/helloworld-wasm

Run an already created WASM (as standalone) with docker:

docker run --rm --runtime=io.containerd.wasmedge.v1 --platform=wasi/wasm secondstate/rust-example-hello:latest