Few necessary things You need to do after buying VPS server
Buying your first own VPS server is a big step in your self-development. Many new difficulties that You will face, many new things and technologies that You will learn.
But where to start? What is important and what isn’t?
Look at the below checklist to kickstart the VPS journey!
The first thing that you should do is securing a fresh server. There are easy and more advanced ways. Most common ones You can find below:
- Change your SSH port (22) on something unusual like 6789.
- Turn off password authorization for SSH (or use some crazy one for emergency purposes) and switch to key-based authentication.
- Turn on a firewall or write your own script that will use iptables.
- Install Fail2Ban, a utility that will block someone who is brute-forcing your password.
- Do not leave default ports for new applications e.g. databases, chats, application servers e.t.c.
- Use SFTP instead of FTP (You don’t need FTP server, that’s a fact).
- Turn off your webserver error info, version, default page, and similar options.
For basic VPS configuration, You only need two components listed below. It’s that simple! Everything above that is learning and experimenting.
- Web server, start from something very simple like Apache and complicate it on the go. You can change MPM (Multi-Processing Module) on Event, enable PHP-FPM, and tweak many other settings. There is a lot to learn and a lot of setting combinations to experiment with.
- Database, the most popular one is MySQL, but for me better optimized and fully compliant with MySQL is an open-source alternative called MariaDB.
There are many useful utilities that can help with server monitoring and administration. On my list, You could find only the basic one for beginners.
- Backup your files, configurations, and databases regularly. One of the fun solutions is writing a bash script and uploading backup to Scaleway (50GB free cloud S3 storage).
- Uptimerobot – monitor your web pages and get instant notifications when something is wrong.
- Server status – check your server status without using the terminal:
– Server Status wrote by Adam
– eZ Server Monitor (make sure You protect access to it with .htpasswd file)
Useful things and tips
- Docker – create containers with things You wanna test or easily upgrade without any hesitation.
- pm2 – clever production process manager for Node.js
- Next Cloud (your own storage) with Redis as an in-memory cache (look here for instruction).
- Speed up your website with Apache and Cloudflare (link to article)
Maybe have some fun?
You bought VPS to gain some knowledge, right? Try some hard or fascinating things. Install new software to test it out. Create scripts that will automatize your most time-consuming tasks.
- Cloudflare – so many settings and possibilities that You will get lost for a few days playing with all switches.
- Python and web scraping. Get e-mail notifications, present data on your own web page, and many more. Make something useful.
- Bash scripts automating things – renewing SSL certificates, clearing some old backup files, or cache.
- Install web server that is not Apache -> Nginx or Lighttpd
- Use MariaDB instead of MySQL or maybe You can find another alternative.
- Create your own VPN using your VPS.
- Make your home page or portfolio with links to your social media accounts.
- Optimize everything that could be optimized :D
- Configure your own private git repository with GitLab or something lighter like Gogs.
- Host your own password manager – https://bitwarden.com/
- Heard of Heroku? Try out Dokku, selfhosted mini-Heroku – https://github.com/dokku/dokku
For me buying my first VPS server was a game-changing step. One of my friends convinced me to buy a little one on OVH. After basic configuration, I got craze to optimizing everything, literally everything. Starting from web server, database, PHP-FPM ending on websites, and digging deeply into Cloudflare. After a few years, I gained a ton of new knowledge and unusual experience that make a difference in many companies.
I hope that You will have a similar learning experience and intensive curiosity like me! Let me know about some great stuff that should be added to the above lists.