A Beginners Guide To Selfhosting Part 5
In Part 5 of my Beginners Guide To Selfhosting, we will go over general best practices, when working with a VPS and Docker containers.
Best Practices
Before going through my services, here is a list of best practises which I highly recommend you follow.
Use long and secure password
Use a password generator of your choice and generate a password with a length of at least 20 and a mix of upper- and lowercase characters, numbers and symbols. If you don't already use it, I highly recommend Bitwardens Password Generator.
2 Factor Authentication (2FA)
With 2FA, your service will be safe, even if someone steals your username and password. I personally recommend Ente.io and highly discourage the use of Googles or Microsofts authenticator.
Create User Accounts
During the setup of your services, you will create an admin account. Don't use this account for general usage. Create a user account with limited access instead.
Block public access
Some services may offer public access / user registration. I always disable this and make sure I have to manually add any user I want to give access to my services to prevent bot registrations.
Enforce safe passwords / 2FA
If possible, change the settings of your service so any user will have to use 2FA and a secure long password. Otherwise they will just change their password and lower the security of your services, without you knowing.
Regular Updates
Check your services for updates regularly. While there are many solutions to automate this process, I personally keep it manual and run docker compose pull on my services once a month, unless a security problem is found.
Regular Backups
Make a regular backup of your services, so you can quickly restore them if anything goes wrong. You'll find a guide of how you can backup and restore your services in Part 3.
Personal recommendations
Don't be afraid of mistakes
You can and will make mistakes, when setting up your first server. Don't be afraid of breaking something and instead learn from it. If you have regular backups, it's quick and easy to roll back changes you made.
Try to fix it before asking for help
Take your time and try to figure out what went wrong. Don't just go to /r/selfhosted and demand help.
Read the manuals
Ubuntu Server, Docker and all services have extensive documentation available. If you want to know something, chances are high that you will find it in the official documentation.
Give info when asking for help
If you still cannot fix a problem yourself and need to ask for help from communities like reddit, be sure to give as much information as possible, including (but not limited to):
- What you already did to try and fix it
- Service logs (sudo docker logs SERVICE_NAME)
- Error messages
That concludes Part 5 of my Beginners Guide To Selfhosting. In Part 6 we will go through all the services I host, and how to set them up on your own VPS.