serendipty01's blog

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?

https://sive.rs/ti

Don’t build your castle in other people’s kingdoms HN HN 2

15 year old YT channel deleted Part 2

alter-the-deal 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/

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:

  1. Provision a server
  2. add your public key in VPS provider website
  3. ssh into your VPS
  4. disable password authentication #PasswordAuthentication yes -> PasswordAuthentication no systemctl restart ssh
  5. Create a user and disable root ssh access (Optional but recommended)
  6. 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
  7. Step : Add a firewall In UI whitelist only port 22, 80, 443
  8. Step : Buy a domain and point to your VPS (Optional)
  9. Step : Add a reverse proxy
  10. Step : Setup a website
  11. Step : Install Docker
  12. Step : Install Applications