As one of the most popular single board computers on the market, the Raspberry Pi is a mainstay of most Linux users. Whether it’s for home server applications, kids’ computers, learning Linux, or some other skill, you can surely find a use for the Pi. Given its popularity as a home server, we’ll show you how to install CentOS on your Raspberry Pi to create a rock solid home server.
Get the CentOS image
Raspberry Pi images specific to the CentOS project are somewhat hidden in the download page. For the best experience, I recommend using CentOS 7. On the CentOS home page, click on “CentOS Linux”.
Click on “7 (2003)”. This version number may change over time.
Choose the mirror closest to you on the mirror page, and you will be presented with a list of options. There are a few that are important to this project: four at the time of writing this article that say “RaspberryPi” in the name. For my case, I’m going to grab the one that says “RaspberryPi-Minimal-4”, as I’m installing this on a Raspberry Pi 4b. Make sure you choose the one that works best for your particular use case.
Flash your SD card
For most users, Balena Etcher is probably the best choice for flashing your Raspberry Pi SD cards. One of the key things is that it will flash directly from the xzip archives you download for most Raspberry Pi images.
The flashing process is easy. Launch the application, select the source file (the CentOS archive in this case), the SD card port and click on “Start flash”.
It won’t be a long time before it’s all done and you can boot from your SD card on your Pi.
Start CentOS on your Raspberry Pi
With these images, it should be as easy as turning it on and waiting until you get to the command prompt. If you were able to install the KDE or GNOME version, you will be taken directly to the login screen.
The default login information is:
- Username: root
- Password: centos
An important note: change the root password and immediately create a non-root user for yourself. If you don’t, there’s a good chance that someone (aka hacker) will know about it and enter your system with root access. It’s not good. The commands to create a new user are as follows:
Change your root password:
Create a new user:
Replace your preferred username and password. This command will create a user in the
sudo group, allowing you to completely switch users and avoid logging in as root. Once you do this, be sure to use the
su command to switch users to your newly created user like this:
Replace the username of the user you just created. From there, make sure your packages are up to date with the update command:
Installing a graphical desktop environment
This is one of the simpler parts. You can see the available software groups with the following command:
Choose the one you want to install. I will install GNOME, but KDE Plasma is also available.
It seems to depend on the Raspberry Pi you are using. On my Pi 4b, I couldn’t
systemd to jump into the GUI even though it said it was running. Your mileage may vary.
Now that you have learned how to install CentOS on your Raspberry Pi, you can now create an IRC server or configure a Tor proxy or Wi-Fi bridge. The easiest of all is to create a personal web server.
Is this article useful?