+--------------------------------------------------------------------+ 
|                                                                    |
|  Christopher Bohn                    @/books   @/blog   @/contact  |
|                                                                    |
+--------------------------------------------------------------------+

* Introduction to Self Hosting ................................. [001]
* Checklist .................................................... [002]
* Preparing the Raspberry Pi.................................... [003]
* Installing NGinx ............................................. [004]
* Connect Your Domain and Server with DDNS Records ............. [005]
* Port Forwarding .............................................. [006]
* Secure Your Server with Certbot .............................. [007]
* References ................................................... [008]

[001] Introduction to Self Hosting
______________________________________________________________________

Many people host static websites on services like Github Pages [0] and
Source Hut Pages [1]. These are great services to deploy simple sites
like a blog or simple landing page for a business. However, if you
would like to host something like a Calibre web server (#/books) or a
Jellyfin media server (#/jellyfin) you will need a server.

Online most people will recommend renting a VPS (Virtual Private
Server) from a provider such as Linode [2]. However it is possible to
host a web server on just about any old computer in your own home. In
order to keep the scope of this article managable I am going to
specifically focus on how to self host on a Raspberry Pi running
Debian. Although with a little bit of thought most of what is in this
article will apply to any machine running a (Unix-like) operating
system.

[002] Checklist
______________________________________________________________________

Before you follow this guide ensure you have the following:

   - A Raspberry Pi
   - A MicroSD Card
   - An SSH key pair on your primary system
   - A Router capable of Port Forwarding
   - Patience

[003] Preparing the Raspberry Pi
______________________________________________________________________

The first thing you will need to do is install Debian on the Raspberry
Pi. You can find a link to the Debian image here [3]. After you down-
load the image you can write the image to your MicroSD. To write the
image to your SD card run the following command:

+--------------------------------------------------------------------+
|                                                                    |
|  $ xzcat *bookworm.img.xz | sudo dd of=/dev/{YOUR_DEVICE}          |
|                                                                    |
+--------------------------------------------------------------------+

Make sure you replace {YOUR_DEVICE} with your SD card's device. Wait
for the command to finish. After the command has finished you will
need to edit the value for the root_authorized_key in the
/sysconf.txt with the contents of your ~/.ssh/id_rsa.pub on your
primary machine.

Now you can insert the Micro SD into the Raspberry Pi and connect via
SSH.

[004] Installing NGinx
______________________________________________________________________

TODO

[005] Connect Your Domain and Server with DDNS Records
______________________________________________________________________

TODO

[006] Port Forwarding
______________________________________________________________________

TODO

[007] Secure Your Server with Certbot
______________________________________________________________________

TODO

[008] References
______________________________________________________________________

[0] https://pages.github.com
[1] https://srht.site
[2] https://www.linode.com
[3] https://raspi.debian.net/

______________________________________________________________________

GPG A882323691303908C65178AFCB2A32B7EF676F89

The content for this site is CC-BY-SA
The code for this site is MIT