Despite appearing intimidating at first glance, containerized services are pretty easy to deploy, especially with all the home lab tools at your disposal. Sure, running Docker/Podman commands via a terminal is the ideal way to go about building your container library, but they can seem a tad too difficult if you’re not even accustomed to CLI-heavy utilities, let alone server distros. The desktop variants of Docker and Podman can help newcomers out quite a bit, but containerization platforms further simplify the esoteric art of self-hosting by providing a neat UI to grab templates and deploy them inside containers – all with the press of a button.
I’ve been using CasaOS for the longest time, but I’ve started checking out other platforms lately. This search inevitably led me to Cosmos, and having used it for a couple of weeks, I’m pleasantly surprised at how useful this app is, even though it’s shrouded by a veil of obscurity.
Docker vs. Podman: Which one's better for your self-hosting needs?
Can Podman dethrone Docker to become the king of containerization platforms?
Cosmos is an underrated platform
A sleek UI with multiple services... from different app stores
An easy-to-access interface is crucial for a container-hosting platform, and Cosmos is well-equipped on this front. The Home section offers a neat overview of all containers, alongside the CPU, network, and memory cores occupied by the Cosmos server, and I’d rank its interface above Runtipi in terms of aesthetics.
But a pretty UI isn’t the only thing Cosmos has going for it. The application store (or Market, as it’s called here) is armed with tons of neat container templates, ranging from community-favorites such as Nextcloud, Immich, Jellyfin, and Vaultwarden to Paperless-ngx, Kavita, and other lesser-used apps in my repertoire. While the Cosmos Market includes a plethora of cool tools, it’s definitely missing Pi-hole, Snapdrop, and a couple of other standout services.
Thankfully, Cosmos can pull container templates from other app stores, including the one used by CasaOS, by adding their respective links to the Sources section. Besides CasaOS’ repo, I’ve also added the TinyActive and Unofficial app stores, so I can access an even larger collection of services from my Cosmos server.
Easy network and storage management
Mapping ports and mounting storage volumes are the more tedious aspects of container management, though Cosmos takes some complexity out of these tasks. The Storage tab, for instance, can display the S.M.A.R.T. metrics of the drives attached to the Cosmos server inside the Disks section, while the Mounts menu lets you add new storage volumes to your containers as well as modify the configurations for the existing ones. Heck, you can even merge volumes or set up Parity storages directly on this container-hosting platform.
On the networking front, the URL tab lets you set up proxies for your self-hosted services, making it extremely useful for folks who prefer custom domain names for their home lab utilities. Managing certificates is just as simple, and you can even configure robust security rules for your containers as well as keep a weather eye on them using the built-in monitoring utilities.
Cron jobs and OpenID integrations are cherry on top
As if the plethora of container management options aren’t enough, Cosmos includes some automation facilities via the Cron job integration. There’s also support for OpenID-based logins, which is quite useful if you use an authentication service like Authentik to enable easy and secure access to your home lab.
Unfortunately, it has a couple of paywalled features
Before I begin, let me say that I have a lot of respect for the developers behind these self-hosting projects, and there’s nothing wrong if they add some extra services for premium users. However, I’m not a fan of how Cosmos implements these services – both in its documentation and inside the web UI.
If you head to the project’s GitHub page, you’ll notice the VPN and Backup options mentioned in the documentation, and keen-eyed folks may have already noticed them inside the web UI. Unfortunately, both services are locked behind a paywall, which can seem rather annoying if you’re a FOSS user like me and wanted to switch to Cosmos for precisely these utilities.
Self-hosting Cosmos is fairly simple
Docker or LXC: Pick your poison
Like its container-hosting rivals, there are a couple of ways you can deploy Cosmos. The first one, and arguably the easier method, requires you to have Docker installed on your server. Afterward, all you have to do is execute the following command inside the terminal, and watch the platform bring itself to life out of thin air:
sudo docker run -d --network host --privileged --name cosmos-server -h cosmos-server --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket -v /:/mnt/host -v /var/lib/cosmos:/config azukaar/cosmos-server:latest
If you’re particularly mindful of your Cosmos server's security, you can set up a rootless container for it to avoid using the sudo command. Likewise, you can remove the --privileged attribute to reduce the platform's security permissions and prevent privilege escalation, though that can cause some issues in the long run.
Me? I prefer running my Cosmos instance as an LXC on my Proxmox server. That way, I can easily allocate as many CPU cores, memory, and storage resources to it. Plus, the Proxmox VE Helper-Scripts package for Cosmos makes the installation process a cinch. If you’ve never used this repository, simply head to the Shell tab of your Proxmox node and execute this command:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/cosmos.sh)"
By default, the script assigns 2 CPU cores (or rather, v-cores), 2GB of RAM, and 8GB of disk space to your Cosmos LXC, which is far too little for a container-hosting platform. So, I recommend choosing the Advanced options and manually assigning more system resources to your Cosmos Cloud.
Once you’ve deployed the Cosmos server, you’ll have to pick a database and create your user account to gain access to the platform and start building your container library.
What’s your favorite containerization platform?
If you’re not a fan of Cosmos, there are several other neat tools that let you host containers from menu-based web UIs. I’ve been using CasaOS for the longest time, and it’s pretty easy to deploy on any ol’ Linux distribution. For developers, Yunohost is a handy alternative, though you’ll have to relegate an entire VM/bare-bones system to it. For Raspberry Pi users, Runtipi and UmbrelOS are solid options, but the latter has the same bare-metal installation requirement as Yunohost and bundles in one too many crypto-centric apps for my liking (even though its UI is pure eye-candy).
5 things I do to simplify self-hosting
Building a container empire doesn't have to be difficult
