πŸ’Ύ Archived View for tilde.pink β€Ί ~chizra β€Ί selfhosting β€Ί intro.gmi captured on 2022-01-08 at 14:03:19. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-03)

➑️ Next capture (2023-01-29)

-=-=-=-=-=-=-

I'm listening to this wonderful Spotify playlist as I'm typing this:

Spotify playlist – Label: Music From Memory

Introduction – Sept 4, 2021

Since I started working on my graduation project, Sunday Sites[1], one and a half year ago, I've been thinking about setting up a server at home. As Sunday Sites aims to show that it's easier than ever to claim your own space on the internet, self-hosting the project website would be the ultimate way of doing just that. It would also be such an accomplishment to have set up a server all by myself. I'm sure it's going to be quite a challenge for me as I've never done anything like this before, but after roughly a year of getting acquainted with SDF.org[2], Tilde.pink[3] and most importantly – the terminal – I don't think it's going to be impossible.

I'm planning to host a few websites and a Gemini capsule (perhaps Gopher as well, but we'll see), but there's of course more to take into account, like choosing the hardware and operating system, setting up port forwarding and so on. I'm going to write about everything I know so far here, and whenever I change my mind about something, I'll add to that part so you know my thoughts behind it.

[1] Sunday Sites

[2] SDF.org

[3] Tilde.pink

Hardware

For a long time, I thought about turning my old MacBook Pro into a server, but recently I've decided to go for a Raspberry Pi instead, as that will take up much less space by my router – and I can use the MacBook for something else if I want to.

I'm leaning towards getting a Raspberry Pi 4 with 8GB RAM – even though I could go for a less powerful model, the price difference isn't that huge, and the more powerful model would probably keep working for longer(?)

The RPI doesn't come with anything else than the board, so I will need:

Once I've got it working, I'll probably list everything I'm using here (or not, we'll see).

[4] Nutshell Pi Case

Operating System

I somehow feel a strong connection to NetBSD[5], as I've used it on both SDF and Tilde.pink and I like the thought of running this old and reliable OS on my own server. However, I could imagine it being a bit too complicated for a beginner to set everything up from scratch and then maintain it.

I've also read good things about OpenBSD[6], and the security aspects of it makes it seem like a good choice if I'm going to build something interactive on the web. Although, NetBSD is probably about as secure and OpenBSD is probably just as complicated to work with, so I could just go for NetBSD.

My plan is to start with trying NetBSD, but if that is too hard I will go with the default Raspberry Pi OS (previously called Raspbian) and try the harder way again at a later date.

[5] NetBSD

[6] OpenBSD

Web server

For a long time, I thought Apache[7] would be the obvious choice. I mean, it's been tried and tested since 1995 and there's probably a lot of people who can help if anything goes wrong. Recently though, I've become more interested in setting up Lighttpd[8] instead as it seems fairly easy to use and could make even better use of the limited hardware. It seems like I will also need to install PHP separately, but that doesn't seem too hard either.

[7] Apache

[8] Lighttpd

Gemini server

There is a lot of Gemini server software to choose from[9] – it feels a bit overwhelming actually, and I've yet to find any complete beginners writing about their choices for Gemini servers. That being said, I read somewhere that Agate[10] would be a good starting point, since it's easy to set up, has very few features and "should be quite efficient even when running on low-end hardware and serving many concurrent requests". And indeed, after reading the (very well-written) setup guide, it seems like the easiest step in this whole process.

[9] List of Gemini servers

[10] Agate

SSH & (S)FTP

I haven't researched how to properly set up SSH and SFTP yet, but it's probably good practice to disable them for the root account. And I'm pretty sure I'm not going to be connecting through regular FTP, but do I need to do something extra to set up SFTP? This will need further investigation.

User accounts

I'm not sure about how many user accounts I should make yet – but from what I understand, I should at least make one for the web server and one for the Gemini capsule. But should I make one account for each hostname on the web server? And how does the hostnames work if the IP address is the same (or can I just have one web server per device)? Also, should I install the software on the root account or on the other accounts? All of this also needs further investigation.

Domain name(s)

I already own one of the domains (sundaysites.cafe) that I'm going to be using, but my plan is to make an additional website with a new domain. It's going to be a personal website, or a 'website garden', for everything that doesn’t fit on my portfolio site – like code experiments, writings and more abstract kinds of design. The same domain would also be perfect to use on the Gemini capsule. However, I have no clue on what to name it! I don't want my own name to be in it, and I don't think I want anything with my usual 'chizra' handle either. What I do know is that I'm leaning towards a .net or .org TLD, since I love the net art aesthetics they would bring – but if I come up with something that goes well with newer TLD's (like .park, .world, or .zone) I'm not unwilling to change my mind.

I usually use Namecheap[11] to buy my domains, and will be doing so here as well. And for inspiration, I'll probably use Domainr[12] to come up with the name.

[11] Namecheap

[12] Domainr

Port forwarding

This one I read about last night. It's not something that is usually mentioned in the set-up guides I've read, but it doesn't seem too hard. Once I have the server turned on and connected to the internet, I'm going to open my router's settings by typing its local IP address (usually something like 192.168.1.1) in a standard web browser to see what local IP address the server is using. Once on this step, I'll read more on how to properly go on from here (how to set up a static IP address and so on), but essentially I'd want to open some of the ports for the server's IP address so that it can be visited from outside of my network.

Standard ports:

I know that Lighttpd lets me set the port manually, and I would imagine that could be done for some of the others too, but it's nice to have a list of the standards here in case I forget. Also, Wikipedia has an extensive list of other ports[13].

After this is done, I will add the IP address(es) to the DNS records of the domain(s) on Namecheap.

[13] List of TCP and UDP port numbers, Wikipedia

Things not on the list

There are of course other things I could use the server for, but for now, a web server and a Gemini capsule will be more than enough.

Things I won't focus on:

Concluding thoughts

I think this journal is a good way for me to plan everything. Having a list to go back to if I forget, and also a way to motivate myself to go forward. As mentioned, I don't think this will be the easiest thing I've done, but that's part of what makes it fun and one of the biggest reasons to do it. I see this server as a complicated dish to make, one with many different recipes for every single step, but with enough time, care and effort – the results should be delicious!

There are still some questionmarks to research for me, and if anyone is reading this and knows an answer to one or two of them, I would love to hear from you!

Email me at

chizra@tilde.pink

or write to me on twitter

@johnxbengtsson

Links

[1] Sunday Sites

[2] SDF.org

[3] Tilde.pink

[4] Nutshell Pi Case

[5] NetBSD

[6] OpenBSD

[7] Apache

[8] Lighttpd

[9] List of Gemini servers

[10] Agate

[11] Namecheap

[12] Domainr

[13] List of TCP and UDP port numbers, Wikipedia