How to Install a Docker-Driven Home Server on Ubuntu With CasaOS

CasaOS is an open-source software built around the Docker ecosystem. When combined with Ubuntu, it can be used to host a Docker-driven home server. Learn how.  

Written by Guilherme Oliveira
Published on Feb. 12, 2025
Developer using docker on their laptop
Image: Shutterstock / Built In
Brand Studio Logo

After years of receiving reminders about my Google storage service subscription, I decided to build my own solution to save my files and run and host data-related projects. To do so, I built a Docker-driven home server on Ubuntu with CasaOS. 

3 Steps to Install CasaOS on Ubuntu for Docker

  1. sudo apt-get update: Make sure your system can access the latest packages available.
  2. sudo apt install curl: Install the curl tool on your system, which is necessary for downloading the CasaOS installation script.
  3. curl -fsSL https://get.casaos.io ' sudo bash: Download the CasaOS installation script and then execute it.

CasaOS is an open-source software that simplifies and provides a user-friendly experience for managing and monitoring home lab applications. Despite the name, it’s not an operating system per se, but a software that runs on top of a Linux system. One of the advantages is that it’s based around a Docker ecosystem. So, when something goes wrong in the process of adding a service, removing all traces of it and starting a new container with a fresh application only takes moments.

In the following paragraphs, I’ll share the overall process of how I used an old laptop to set up my current home server environment, and how you can, too. 

 

Choose a Hardware and Software for the Home Server

A server is simply a computer that has a high availability to serve a function. It’s possible to create one from any piece of hardware you can run an operating system on. Some of the easier options to a home lab are:

  • Repurposing an old personal computer: Most IT professionals or enthusiasts have at least one old laptop lying around the house. Since the basic system of a server is much lighter than that of a personal computer, that old hardware is likely sufficient for most applications.
  • Virtualizing a system on the cloud: Any cloud provider, such as AWS or any specialized services that host virtual machines, offers solutions to have your own Linux system running remotely in a physical structure probably more reliably than your old laptop. Those can cost only a few dollars per month or even be available within a free plan if you are using only a small computational power and storage.
  • Buying a low cost hardware: Acquiring a Raspberry Pi or Mini PC can be very advantageous, not only for their small size, but also leaving more space for upgrades and sometimes having more advanced capabilities that may not be in older computers such as USB 3.0 or a more modern network board.

I used an old laptop at home that worked well enough with a decent i5 processor and 8 gb of RAM. 

Choose Your Software

There are many possibilities regarding operational systems to use on the server. All of my options were Linux based. The difference comes from the specificity of the system that can have multiple focuses. They can be divided in three main categories:

  • Network Attached Systems (NAS): NAS systems natively offer options to create redundant data storage and manage access profiles, which allows for robust and secure storage and data sharing. TrueNas is an enterprise solution with an open source community edition highly suitable for residential usage.
  • Hypervisors: Focused on managing virtual machine and containers, Hypervisors can be a very robust and flexible solution. The most famous of these operational systems is the open-source Proxmox Environment.
  • General Purpose Linux OS: Maybe the simplest way to start with a server is to just use the Linux distribution of preference and start developing the solutions wanted. It can be done directly in the system or with Docker containers. This approach doesn’t include any features specific for home servers and allows the user to more easily adjust the robustness and complexity of its application. Ubuntu and Debian are excellent choices with enormous communities and can start being used as servers even in their desktop version.

For simplicity sake, I chose to start using my server in my desktop version of Ubuntu. This choice is also suitable for my learning purposes, as it allowed me to configure the system without predefined features, unlike other specialized systems.

Adding CasaOS

Once installed, CasaOS provides a dashboard to monitor computer resources, network traffic and a very elegant way to install and manage Docker containers. In its app store, you can pull and run an image from a Docker hub and be redirected to its address by clicking on the app icon. It also comes with a file manager app that allows the user to visualize data on storage devices and easily share it with your local network. You don’t lose any ability or freedom to manage docker containers or even serve applications installed directly on the main OS, but it can be a huge help.

More on Software EngineeringHow to Revert a File in Git

 

How to Set Up Ubuntu and CasaOS for Docker

Ubuntu Server

Even though the Ubuntu server isn’t as user-friendly as the desktop versions, installing it can be very easy and straightforward. With the ISO image, software such as balenaEtcher can be used to create a bootable USB drive. From that point, all that’s needed is to run the server machine with the USB drive and follow the instructions. Take note of the local IP address from the ‘networking’ step.

Ubuntu server installation page
Ubuntu server installation page. | Screenshot: Guilherme Oliveira

At the end of the installation, the machine will reboot. If you’re using a laptop, you’ll need to update a specific configuration file to keep the computer running even when the lid is closed. The file for this configuration is /etc/systemd/logind.conf and add HandleLidSwitch=ignore to the file and save it. The rest of the file is commented with the default values. Once the file is updated, run systemctl restartsystemd-logind.service to make sure the changes take effect.

updated /etc/systemd/logind.conf file
Updated /etc/systemd/logind.conf file. | Screenshot: Guilherme Oliveira

The local IP address can be obtained with the command hostname -I ‘192.168.0.223’, as in the example below. After that, the lid can be closed and every other step can be done in another in the same local network.

hostname -I function execution
Hostname -I function execution. | Screenshot: Guilherme Oliveira

To do that, on the other computer terminal (for Mac and Linux) or command prompt (Windows), the ssh connection that will allow control of the server is made by using the command ssh user@local_ip_address and authenticating with the password defined in the installation. From that point on, every command is executed on the server machine.

Connecting with ssh on the server.
Connecting with ssh on the server. | Screenshot: Guilherme Oliveira

CasaOS

Installing CasaOS is simple in Ubuntu. The necessary commands are:

  1. sudo apt-get update: Make sure your system can access the latest packages available.
  2. sudo apt install curl: Install the curl tool on your system, which is necessary for downloading the Casa OS installation script.
  3. curl -fsSL https://get.casaos.io | sudo bash: Download the Casa OS installation script and then execute it.

After running those, the following text appears indicating the beginning of the installation.

CasaOS installation page
CasaOS installation initial output. | Screenshot: Guilherme Oliveira

The script is going to install all the dependencies and end when the software is running and available in the local network.

CasaOS installation final output.
CasaOS installation final output. | Screenshot: Guilherme Oliveira

After accessing the local address in your Internet browser of choice, a prompt to create a user and password is going to appear. After logging in for the first time, the initial interface will finally appear. This environment, though simple, contains very useful features, such as:

  • General management icons (top left corner) from where the main machine logs can be viewed, the terminal accessed and account and general CasaOS settings updated.
  • A system monitoring dashboard, containing compute resources usage status, storage units available and network usage metrics.
  • App icons, which redirect the user to a specific port in the host computer where the Web UI of the service should be.
A tutorial on CasaOS. | Video: TechHut

 

Serving Applications With CasaOS

Made to work around the Docker ecosystem, CasaOS provides a simplified and friendly experience to install containers from its app store. There are dozens of images with predefined configurations ready to be deployed in just a few clicks. Once installed, an icon is going to be added to the dashboard to redirect from where the user should be able to start interacting with it.

CasaOS app page
CasaOS app store. | Screenshot: Oscar Guilherme

It’s also possible to customize installations or create new ones using the container settings page. This approach is very similar to creating a Docker-compose file in a friendly user interface. It's also possible to import those settings from a Docker-compose file or Docker CLI commands. After the installation, this page is also useful to verify logs and access the container terminal directly.

Container setting pages.
Container settings page. | Screenshot: Guilherme Oliveira

One of the biggest learnings of this comes from the fact that even with the help of the CasaOS ecosystem, for almost every container installed there was at least one pitfall or caveat that was needed to understand in order to make it work properly. The next lines are dedicated to mentioning some of those containers and what one should additionally know before trying to use them.

Portainer

Portainer container list
Portainer container list. | Screenshot: Guilherme Oliveira
  • Function: This container management platform allows the user to have a lot of control over the deployment and maintenance of containers. Also, it is great to execute tests.
  • Caveats: The version installed by the CasaOS app store contains a bug that doesn’t allow access to the container’s console. Don't stick to the default option this time.

Pi-hole

Pi-hole main dashboard
Pi-hole main dashboard. | Screenshot: Guilherme Oliveira
  • Function: Pi-hole acts mainly as a DNS sinkhole, monitoring the network traffic and blocking undesired domains. By default it comes with a list of almost 160,000 domains related to ads, but there are plenty available online.
  • Caveats: For Pi-hole to work, the machine it’s running on needs to be added as a DNS server in the router’s configurations. When using Ubuntu, the default DNS port (port 53) on the machine is already being used by Ubuntu’s internal DNS server. To install Pi-hole on port 53, it’s necessary to disable this native Ubuntu DNS service.
Disabeling this native Ubuntu DNS service
Disabeling this native Ubuntu DNS service. | Screenshot: Guilherme Oliveira

NextCloud

Nextcloud marketing demonstration image.
Nextcloud marketing demonstration image. | Screenshot: Guilherme Oliveira
  • Function: Nextcloud is a suite of client-server software that proposes to be a self hosted alternative for cloud services. With it, it’s possible to easily manage multiple users. It also contains mobile apps with functionalities to even automatically backup files.
  • Caveats: The basic installation is pretty straightforward and uses a SQLite database. In order to use the auto uploading features, it’s recommended to use other databases, such as Postgres. Additionally, it also blocks the installation if some external device is selected to storage files. 

Code/Anaconda

Conda Jupyter server UI (Left) / Python program on Code server (Right)
Conda Jupyter server UI (Left) / Python program on Code server (Right). | Screenshot: Guilherme Oliveira
  • Function: Anaconda and Code server are the chosen tools for development. The first one provides a Jupyter interface ready to develop data applications, and a Jupyter server that can be easily accessed by every computer, so there is no need to use only the server UI. On a more general approach, code-server provides a complete development environment, with a large variety of plugins to install.
  • Caveats: In order to log in to the UI and access the Jupyter server, the user needs to use a token that is shown on the installation logs. For code-server, it’s important to notice that it doesn’t come with any program or programming language pre-installed.

Airflow

Airflow dashboard
Airflow dags dashboard. | Screenshot: Guilherme Oliveira
  • Function: Airflow is a largely used orchestration tool for developing, scheduling, and monitoring batch-oriented workflows. It’s open source and contains a complete variety of functionalities and a very large online community.
  • Caveats: Since it uses multiple services, installing airflow using Casa OS features is challenging. Following the official installation tutorial using the console is the easier option. Installing for other methods will make the CasaOS automatic icon not work completely, but the user is also able to create custom ones pointing to the intended UI port.

Metabase

  • Function: As the popular open-source BI solution, Metabase provides a complete set of features to connect to and explore databases, create dynamic dashboards and manage multiple users, each with specific permissions.
  • Caveats: One thing not easily found on the forums is how to save the settings (users, connections, dashboards…) once the container is turned off. For that, the file a volume syncing with the container file /metabase.db needs to be created on the host machine.
Metabase container settings
Metabase container settings. | Screenshot: Guilherme Oliveira

Cloudflare Tunnel

  • Function: There are multiple ways to make the self-hosted services available from outside the local network, each with its own pros and cons. One of the simpler ones to use is the Tunnels from Cloudflare zero-trust framework. In a nutshell, it relies on a service, that can be run on a docker container, that creates a secure connection between a port in the server machine and the Cloudserver network that used another secure connection to the rest of the internet.
  • Caveats: Even though creating a tunnel can be free for development and testing purposes, a domain name is needed. One can be bought directly from Cloudflare. Also, since it relies on the tunnel service, once the container running it is shut down, it stops working.

More on Software EngineeringWhy Open-Source Companies Must Rewrite Their Playbook

 

Advantages to a Docker-Driven Home Server on CasaOS and Ubuntu

Setting up a home server with an old laptop, Ubuntu and CasaOS has been both effective and rewarding. The challenges and learning curves have provided valuable insights, enabling me to host various applications on a self-managed server, which offers both flexibility and cost savings.

This experience has allowed me to gain greater control over my data and projects, while also deepening my understanding of server management and containerized applications. Moving forward, this server will play a crucial role in expanding my technical skills and developing new projects. It will serve as a reliable platform for testing and deploying data-driven applications and providing useful services to my household.

Transforming an old laptop into a fully functional home server has equipped me with practical skills and a greater appreciation for open-source technology. With numerous opportunities ahead, this server will be central to unlocking potential and bringing new ideas to life.

Frequently Asked Questions

Yes, you can install Docker on CasaOS. Once installed, CasaOS provides a dashboard to monitor computer resources, network traffic and a very elegant way to install and manage Docker containers.

CasaOS is an open-source software that provides a user-friendly experience for managing and monitoring home lab applications. It’s built around the Docker ecosystem, so when something goes wrong in the process of adding a service, starting a new container with a fresh application only takes moments.

Explore Job Matches.