Migrating from Ubuntu to Fedora server

Trying out Fedora server in place of Ubuntu server. The results are surprising.

Migrating from Ubuntu to Fedora server

I've mentioned before that I run this blog and my own Nextcloud instance on DigitalOcean. Since I started doing that a couple of years ago I've been running on Ubuntu Server 20.04. It is a good, and reliable server OS. It is also an LTS release so I figured I wouldn't have worry about a major upgrade for a few years. These are all great advantages. So why did I switch to Fedora? Has it made a difference?

Why Fedora?

There are few reasons that I wanted to use Fedora on the server. I am a regular Fedora user on the desktop and the main reason is I wanted to try Fedora server offering. I like Fedora's defaults for the desktop and have heard good things about that methodology being used on the server side. Although, this is less of a concern because I use Terraform and Ansible to provision and configure my servers respectively. Fedora does have a smaller support window but I figure that would force me to maintain a secure server.

There is (seemingly) better performance as well. Although, I should have measured a "before" and "after" performance screenshot. But I only have the "after" screenshot because all I got were errors before. I used the Cloudflare Observatory to do a speed test on the site, got a surprisingly good result. I also used PageSpeed check the site and also found it to be surprisingly good.

Cloudflare performance test
PageSpeed performance test

I also found that there less resources used overall by Fedora server. Using less RAM and CPU in general. Although this could be attributed to many different aspects of the OS. Fedora has many different defaults than Ubuntu and does not make use of Snaps. It may also be because Fedora is more aggressive with clearing memory and using more of SWAP space.

There are some nice out of the box features that come with Fedora as well. Mainly the Cockpit server for managing the server. This is a great tool for the managing the server. It has everything that I need to manage my server. From updates, to logs, to monitoring system resources, to even using a terminal to SSH into the server. It also allows to enable auto updates. There is also Cockpit Client desktop application that exposes all the data from the Cockpit server.

Cockpit client

The final reason for using Fedora Server is what I mentioned in the beginning. I just wanted to try it out. Before settling on the Fedora for desktop, I used to distro hop a lot. I finally picked Fedora because of the mix of latest Kernel updates, dedication to open standards, wanting to stay bleeding edge, and stability. I want to test if the same is true for the server side. So far so good.

Nuances

and source code

There were some changes that were required to be made to host a web app on Fedora server, and to get all the features of Cockpit working with Cockpit client.

First, because Fedora enables SELinux by default, we have to modify the SELinux rules to allow us to host a web application. This can be done by enabling the httpd_can_network_connect flag. I added this to the Ansible playbook for my deployment.

And the package needed to get all the Cockpit feature to work is literally called cockpit. After installing this package all of the features should be available. Additional packages may be used to enable more functionality for Cockpit client, like installing tuned for changing performance profiles.

The source code can be found below.

GitHub - mbbaig/ghost-deployment: A Terraform and Ansible project to deploy the Ghost platform
A Terraform and Ansible project to deploy the Ghost platform - GitHub - mbbaig/ghost-deployment: A Terraform and Ansible project to deploy the Ghost platform

Happy Hacking :)