When Heroku got rid of their free tier, it wasn't even like I had a bunch of web apps on there that I really needed to migrate ... I think there was just one (my media server "Video Streamer"). But, I decided maybe this was the right time to switch to self hosting. I did have a Raspberry Pi sitting around, after all.

Since then, I've gotten pretty into it, and am running a number of different services on my Pi. Once you get the hang of it, it becomes really fast to deploy things; faster than setting a traditional hosting service, and also there's a lot of flexibility to add random little microservices and what not.

So, I'm not going to give comprehensive instructions here, but rather just mention the most important things you need to get done. There will also be some concepts explained along the way.

  1. Set up SSH.

  2. Running graphical programs

  3. Running websites, the quick and dirty way

  4. Domain buying

  5. Setting up HTTPS

  6. Nginx - initial setup

  7. Nginx - connecting domain

            server {
          listen 443 ssl default_server;
    
          root /var/www/html;
    
          ssl_certificate  /etc/letsencrypt/live/dissonant.info/fullchain.pem;
          ssl_certificate_key  /etc/letsencrypt/live/dissonant.info/privkey.pem;
    
          ssl_prefer_server_ciphers on;
    
          index index.html
    
          server_name dissonant.info www.dissonant.info;
         }
    
    
  8. Nginx - doing a reverse proxy

                location /app1/ {
                        proxy_pass <http://127.0.0.1:3000>;
                }
    
    
  9. Nginx - using a subdomain.

        server {
                listen 443 ssl;
                ssl_certificate  /etc/letsencrypt/live/jellyfin.dissonant.info/fullchain.pem;
                ssl_certificate_key  /etc/letsencrypt/live/jellyfin.dissonant.info/privkey.pem;
                ssl_prefer_server_ciphers on;
    
                server_name jellyfin.dissonant.info;
                location / {
                        proxy_pass <http://127.0.0.1:8096/>;
                }
        }
    
    
  10. Fail2Ban

  11. Some recommendations for things to do with your fancy self-hosting setup:

Thanks for reading and I hope this was helpful! Feel free to contact if there are issues with my instructions, or possibilities for improvement.