Self Hosting
ℹ️ Note
This guide is only about self-hosting software
WHAT is self-hosting ?
Is it spending time on r/selfhosted.
For students with an educational email(.edu) provided by universities/colleges, Github Education Pack provides lot of benefits such as domain names and hosting credits.
WHY should you self-host?
Don’t build your castle in other people’s kingdoms HN HN 2
15 year old YT channel deleted Part 2
Alter the Deal by codecaptured.com
Kubernetes Slack Github Discussion
HackClub Slack Blogpost and HN Discussion
What can you self-host ?
Catalog - https://selfh.st/apps/
- Dashboard - Glance
- Group Chat App - Campfire Repo
- Identity and Access Management (IAM) - Authelia
- Reverse Proxy - Caddy
- Music Server (Spotify) - Navidrome
- Version Control System (Github) - Forgejo
- Spreadsheet (Excel) - Grist
- Video Server (Youtube) - Peertube
- Password Manager - Vaultwarden
- Photos (Google Photos) - Ente
- Pastebin - Microbin
- and many more
Where can you self-host ?
You can own the hardware or you can on VPS. Starting with VPS is easy.
How can you self-host ?
If you are a student then you can get free Digital Ocean credits with Github Education Pack. Else you can buy a Hetzner machine which are very cheap (like CAX11)
⚠️ Warning
If you do not have an IPv4 address then you cannot git clone from Github. Issue
Digital Ocean machines typically start from $4. Hetzner machines typically start from € 3.79
ℹ️ Note
For Digital Ocean credits, you will have to add a card before the $200 credits are provided and might have to pay $5 as well.
Step : Create a SSH Key What is SSh ? and a ssh key never reveal your private key
1cd ~ # Go to home directory
2cd .ssh # Go to the .ssh folder
3
4# if the folder does not exist then below error will show
5cd: no such file or directory: .ssh
6
7# else check if any id_rsa or id_ed25519 is present in the folder
8
9ssh-keygen -t ed25519 -C "your_email@example.com"
10# Enter file in which to save the key (): Press Enter
11# Enter passphrase for (<path>/id_ed25519): Press Enter
Follow the below steps:
- Provision a server
- add your public key in VPS provider website
- ssh into your VPS
- disable password authentication #PasswordAuthentication yes -> PasswordAuthentication no systemctl restart ssh
- Create a user and disable root ssh access (Optional but recommended)
- Step : Update and Upgrade your packages sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean -y && sudo apt autoclean -y https://askubuntu.com/questions/733434/one-single-command-to-update-everything-in-ubuntu
- Step : Add a firewall In UI whitelist only port 22, 80, 443
- Step : Buy a domain and point to your VPS (Optional)
- Step : Add a reverse proxy
- Step : Setup a website
- Step : Install Docker
- Step : Install Applications