Setting up a test server on a Raspberry Pi is easy. Here are the steps:

  1. Download and install the Raspbian operating system onto your Raspberry Pi. Raspbian is a free operating system that comes pre-installed with many of the tools you need to set up a test server.
  2. Connect your Raspberry Pi to your network and boot it up. Once it’s booted, open a terminal window and type in the following commands: sudo apt-get update sudo apt-get upgrade sudo apt-get install rpi-update sudo rpi-config
  3. In the rpi-config window, make sure that “Enable SSH” is checked and press OK to save your changes. This will allow you to access your Raspberry Pi remotely using SSH (Secure Shell). You can also use this feature to troubleshoot problems or update your software without having to reboot your Pi.
  4. To start setting up a test server, first create an empty directory on your computer called “testserver.” Next, copy the contents of the raspberrypi_testserver folder onto your computer and into the testserver directory. This folder contains all of the files you need to set up a basic test server.
  5. To start setting up your test server, first download and install Apache web server software onto your computer. Apache is an open source web server software that many websites use today. Once Apache has been installed, copy its configuration files from the apache_defaults folder inside of raspberrypi_testserver into the same directory on your computer as Apache itself (usually c:\apache). You’ll also need to create a symbolic link between these two folders so that Apache can find its configuration files: ln -s C:\apache\ apache_defaults C:\apache\conf\httpd\ mv apache ..

The Raspberry Pi started out as an inexpensive device to help students learn about computing, but the Raspberry Pi also makes for an inexpensive test server. With a server operating system on a Raspberry Pi, you can quickly set up a test server at home.

I recently decided to reinstall my Raspberry Pi 3B+ to use as test server for new web projects. My production environment is an Intel rack server running Red Hat Enterprise Linux, and so doesn’t really match the Raspberry Pi at the hardware level. But at the application layer, Linux on Raspberry Pi is still “Linux,” Apache on Raspberry Pi is still “Apache,” and PHP 7 on Raspberry Pi is still “PHP 7.” As long as my Raspberry Pi is set up as a server, instead of a desktop-focused Linux distribution, my work on the Raspberry Pi will transfer pretty easily to my production environment with Red Hat Enterprise Linux on Intel.

While there is no Red Hat Enterprise Linux for Raspberry Pi, Fedora Server is close enough for my needs. I tried to install Fedora 33 ARM Server on the Raspberry Pi, but I couldn’t get wireless networking to work out of the box, despite a note on the Fedora ARM page that wireless networking is supported by default on Fedora 33. The problem seems to be that Fedora 33 ARM Server doesn’t include wpa_supplicant . However, I was able to get everything working by installing Fedora 33 ARM Minimal.

Download the Fedora 33 ARM Minimal image from the Fedora ARM website. You can find the download location in the wiki. Specifically, to install Fedora 33 Minimal on the Raspberry Pi 3, you will need to download Fedora-Minimal-33-1.3.aarch64.raw.xz from the aarch64 supported image for Raspberry Pi 3.

Once you have the Fedora 33 Minimal image, you can install it to a microSD card to boot on the Raspberry Pi later. On your Linux workstation or server, plug in your microSD card, and run this command:

That command writes the Fedora 33 Minimal image to the microSD card. My Linux desktop PC doesn’t have a built-in microSD slot, so I used a USB microSD card reader, which presents the microSD at /dev/sdb . Depending on your system, you might need to use a different media target device.

Installing Fedora 33 Minimal to the microSD essentially dumps a pre-installed image to the card. You’ll need to do all the configuration afterwards when you boot the microSD in the Raspberry Pi for the first time.

Connect your Raspberry Pi to an HDMI display and USB keyboard, plug in the microSD, and power it on. The first boot will take a while while it does some initial setup tasks, during which Fedora will prompt you for local settings including time zone, root password, and user account.

Once my system was up and running, I was able to login as the root user. Since I don’t have a network cable long enough to reach this Raspberry Pi, I needed to set up wireless networking. At the command line, run the Network Manager command line tool nmcli to list the available wireless networks:

If nmcli finds your wireless network, then connect to it with this nmcli “connect” command. Replace $SSID with your wireless network name:

After that, Network Manager automatically creates an entry for you under the /etc/NetworkManager/system-connections  directory, so the system will connect to this network every time you boot the Raspberry Pi.

Since I run the Raspberry Pi is running as a server on my home network, I also need to ensure the Raspberry Pi gets the same IP address every time it connects to the network. On a home network, you can do this through your wireless router. Most routers let you recognize a MAC address and assign it a reserved IP address. My home router gives out IP addresses starting at 10.0.0.100, so I gave the Raspberry Pi a reserved IP address below that range, at 10.0.0.11:

I find the easiest way to manage my Linux systems is with the Cockpit tool. Cockpit makes it easy to pilot your Linux servers via a web browser, allowing you to view logs, manage storage, set up user accounts, and install services. Fedora 33 ARM Minimal doesn’t install Cockpit by default, but you can easily install it as a package using dnf :

Once you’ve installed Cockpit, you need to ensure the Cockpit service is running, and will get restarted whenever you reboot the system. Fedora uses systemd , so you need to start the service and enable it for each reboot with these two “system control” commands:

Fedora’s default firewall will prevent connections to your device, so you also need to open the port on the local firewall to accept connections to Cockpit. You can add the Cockpit service using the firewall-cmd command line tool:

Now you should be able to navigate your web browser to https://10.0.0.11:9090/ to control your Raspberry Pi remotely.

With Cockpit, you can complete any other system setup tasks that you need. To finish setting up this Raspberry Pi as a web server, I installed the Apache httpd web server and PHP 7, then used Cockpit to configure everything to match my production system as closely as possible:

You don’t need an expensive server to set up a robust test server environment. With a server operating system like Fedora 33 ARM Minimal, you can quickly set up an inexpensive test server at home on a Raspberry Pi. And with Cockpit, you can manage everything right from your browser.