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.
- Get Docker/Podman installed
- Get the Docker-Compose ready
- 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
- Home LLM + Home Assistant - https://www.youtube.com/watch?v=kJfIM9siD00
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
- Piper - Also works Text to Voice
Affordable Local Gen AI with iGPU’s
Thanks to to Tech-Practice for inspiration.
Productivity
- Also allows webhooks
Only Office Server
Communication
- Matrix Server: https://fossengineer.com/selfhosting-matrix-synapse-docker/
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:
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?
- https://awweso.me/
- https://github.com/pluja/awesome-privacy
- https://jalcocert.github.io/RPi/about/#where-can-i-learn-more-about-rpi
- https://fossengineer.com/tags/self-hosting/
- https://github.com/anderspitman/awesome-tunneling
- https://github.com/awesome-selfhosted/awesome-selfhosted
How to Secure my Services?
- NGINX
- Cloudflare
- Authelia / Zitadel / Authentik
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.
- You can get more ideas at awesome-WASM
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