Running Ubuntu or Debian server in Docker

Posted on Dec 16, 2025

It is possible to run a container with just Debian, Ubuntu, or Fedora (etc) and use like a headless system. This is tempting for testing certain apps or services to see how it works before moving to a production system.

It is possible alternative for a virtual machine, depending on the task.

Now, there are better ways to do this.

For app testing, using distrobox (even with a custom home folder) is faster and better tooling since it shares some with the host system. A docker testing environment would work for systems that can’t run distrobox.

For Linux desktops there are Webtop containers from LSIO. This will give an ephemeral full desktop and accessible in the browser. This makes it real easy to spin up and test on localhost or in the homelab and then access from any machine.

For Windows there is Winboat or dockur/windows.

Run minimal Ubuntu or in Docker

Syntax is like this:

docker run -d --name=ubuntu -e TZ=America/Los_Angeles --restart unless-stopped -it ubuntu:24.04 /bin/bash

Or:

docker run -d --name=debian -e TZ=America/Los_Angeles --restart unless-stopped -it debian:13 /bin/bash

Obviously you can shorten this up by removing some flags and boil it down to just:

docker run -d -it ubuntu:24.04 /bin/bash

But, I like to always name all my containers and give them the correct timezone at a minimum.

Once running you can access:

docker attach ubuntu

Install whatever you need with apt.

I am just scratching the surface here. You can create a custom network and attach multiple machines or even give them a dedicated IP address using a macvlan.

Why not a virtual machine?

Do whatever you want. I don’t give a fuck.

- - - - -

Did you like this post? Give it an upvote by clicking on the arrows below! Sending me an upvote is like you and I giving each other a high five.

🙏 😎

Thank you for reading! If you would like to comment on this post you can start a conversation on the Fediverse. Message me on Mastodon at @cinimodev@masto.ctms.me. Or, you may email me at blog.discourse904@8alias.com. This is an intentionally masked email address that will be forwarded to the correct inbox.

If you enjoy the random stuff I write here, post to Mastodon, or watch on YouTube, and are feeling generous, I am open to tips of Ko-fi.