edit selfhosting safely
Some checks failed
pipeline / deploy-job (push) Failing after 3m23s

This commit is contained in:
fzorb 2025-01-17 07:47:25 +02:00
parent 467f905c0c
commit f25c5cb60c

View File

@ -13,14 +13,14 @@ Selfhosting is a great way to fight decentralization, however, you might find yo
* You can technically run your whole setup off mobile data, but should you? No, not at all, but in case your ISP goes down you could do this. * You can technically run your whole setup off mobile data, but should you? No, not at all, but in case your ISP goes down you could do this.
## Requirements: ## Requirements:
* **A VPS**: I reccomend https://buyvm.net/ but you can get away with most VPS providers, granted your service doesn't break their AUP. Since I am too poor to rent another VPS from them for the sake of this tutorial, I decided to use Oracle Cloud's generous free tier. * **A VPS**: ~~I reccomend https://buyvm.net/~~ ([BuyVM's future is uncertain](https://lowendtalk.com/discussion/201647/for-immediate-release-buyvm-joins-cloudzy-ai/p1)) but you can get away with most VPS providers, granted your service doesn't break their AUP. Since I am too poor to rent another VPS from them for the sake of this tutorial, I decided to use Oracle Cloud's generous free tier.
* **A domain**: This isn't really required but realistically you're going to need one. I like https://namecheap.com/ but you could get it from other places too * **A domain**: This isn't really required but realistically you're going to need one. I like https://namecheap.com/ but you could get it from other places too
* **A server**: Duh, if you don't have one of those you'll obviously have to run your services on the VPS, which at this point, why even follow this tutorial? * **A server**: Duh, if you don't have one of those you'll obviously have to run your services on the VPS, which at this point, why even follow this tutorial?
## Step 1. setting the VPS up. ## Step 1. setting the VPS up.
I'll be using Ubuntu, but these commands will work on Debian too. I'll be using Ubuntu, but these commands will work on Debian too.
``` ```
sudo apt install curl nginx certbot sudo apt install curl nginx certbot python3-certbot-nginx
sudo systemctl enable --now nginx sudo systemctl enable --now nginx
``` ```
@ -59,14 +59,13 @@ When a user wants to access your website, the Nginx server running on the VPS wi
I'll assume you know how Nginx works, so I won't go into too much detail about how to configure. Below is a pretty simple configuration which can be edited however you want. Do with it as you will. I'll assume you know how Nginx works, so I won't go into too much detail about how to configure. Below is a pretty simple configuration which can be edited however you want. Do with it as you will.
```conf ```conf
server { server {
server_name example; server_name example;
location / { location / {
proxy_pass http://10.8.0.2; proxy_pass http://10.8.0.2;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
listen 80; listen 80;
listen [::]:80; listen [::]:80;