Code Done Right!

Introduction to RPi server

The goal of this tutorial is to set up a minimalistic server on our Raspberry Pi that will be fine-tuned to our needs and run headless – no peripherals whatsoever, just the Pi plugged to your router and power. We will go through every stage needed to accomplish that in the most user-friendly way I can guide you in. I will try to explain everything as we go, but some tutorial parts you will have to just accept in the interest of being newbie friendly. You can research on your own at later time. Most of administration work is googling stuff anyways, seriously. It is good to know how to do it.

With a proper internet connection like good bandwidth, static IP and a domain you will be able to ditch Gmail, Dropbox and a few other services almost completely.

Purpose of this tutorial series

This tutorial series serves two purposes

  • To document everything I have been doing so far in case I need to do it again and forget a step or some code/script
  • To help you set up a similar server for your own needs.

There is a multitude of such guides on the internet, but I am writing this one since none of the available guides are newbie friendly, complete and coherent. I was looking for one like that when starting my journey with Raspberry powered server. Other than that, it is just for my own benefit. If you happen to make use of it, great! I am happy for you, email me and tell me what helped you and what was too difficult to follow.

Tutorials are written in parts so that you can pick and choose which services you want on your server. I will try to make every part independent. Furthermore I will not double the information and will be sending you to a different part should the need arise.

Basic server setup tutorial

Your server is ready when you complete the above steps. It might not have any service installed just yet. But it is a great foundation to build upon!

Services that can be set up

General purpose tutorials

Parts that will be added

I will try to follow the order below, as some services depend on others.

  • Certbot, creating a certificate for establishing a secure connection
  • MySQL + PHP
  • Setting up a WordPress page
  • Email setup
  • Webmail integration
  • Nextcloud server
  • Mumble VOIP server
  • Custom MOTD upon SSH login (message of the day)
  • A script to set up everything automatically! Yes, that is possible as well

You will be able to set up a server perfect for home use, blogging, hosting a forum or that craft beer brewery website that you plan to open. Or maybe an online guild webpage – how cool it would be to send emails from!

A word of caution

Due to reliability issues like power/internet outages and/or administrator stupidity I would not recommend such a server for signing up with services like Steam, PSN or others which you can lose access to permanently due to email loss. You can lose a domain if you fail to renew it for some reason, but I do not foresee Google overlord loosing Gmail anytime soon… On the other hand if you need a server for a non-profit, your MMO guild, local bakery, car mechanic service you are just starting, an event you are hosting or the like, have at it! You can always migrate to a full-fledged server and ditch Raspberry should the need arise down the line and with that kind of experience it will be a breeze! Everybody starts somewhere.

Additionally please bear in mind that using such a server for a large company to store sensitive data like payroll or invoices might not be the best idea out there – get yourself a professional who will do that for you, invest in your future a bit and don’t be an idiot. Hackers more prolific than script kiddies and bots can be a bit of a problem. I am talking about actual hackers to whom your site will be exposed should it get enough visibility and not that one person who posted “I eat farts!” on your Facebook wall when you forgot to log out of that computer in the library. Keep that in mind when storing your data.

Expanding the knowledge

Tutorial on Debian
Cover of The Debian Administrator’s Handbook

Remember that Raspbian is a fork of Debian. If you are stuck, need help with a particular command or just want to expand your knowledge regarding a particular step, a great place to start is the Debian Administrator’s Handbook by Raphaël Hertzog and Roland Mas.

The link will take you to handbook’s website where you can read it online. There are translations to various languages – some more complete than others. You can also download it as a pdf file or buy a physical copy. It is a great read and will help you a lot. I cannot recommend it enough! Even though it has 500 pages, it can at least serve as a supplicant of what is being told here.

If I am talking about packages you can jump to the respective book chapter and learn more. Tutorials have practical knowledge, the book has theory. It does not have all the answers though, you will still have to extensively search online regarding specific packages, but it will greatly expand on tutorials from this site.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.