// LEARN LINUX TV • ARTICLE

Simple Flox Guide: Install Your Development Tools with Ease

Learn how to install and use Flox to create, share, and manage reproducible development environments. This hands-on Flox tutorial covers Python setup, Nix-powered workflows, and seamless SDLC integration.

YouTube player

Thanks to Flox for sponsoring this tutorial! Check them out to make it easier to deploy development environments and integrate with your existing SDLC.

Video-specific Links

What is Flox?

And first, let’s go over what Flox actually is in more detail, and then we’ll get into setting it up.

Flox gives you the ability to download and deploy complete development environments, containing everything you need. And honestly, that alone solves a common problem before I even get into the rest.

When it comes to dev teams, it’s common for each person’s environment to differ – maybe you’ve got a mix of Linux and Mac users, or even a few on Windows. Sure, you could mandate everyone use identical software, but unless you enjoy being resented, a better solution is to create sandboxed development environments that work the same way across every machine.

And having a reliable foundation matters! As my long-time readers and viewers already know, each Linux distro ships different versions of programming languages and shared libraries – and the versions your project depends on might not match what your distro provides. Sure, you could add third-party repositories to get what you need, but then you’re often juggling several projects with conflicting version requirements, which is its own special kind of pain.

Flox addresses situations like those by letting you create reproducible, portable development environments, each with the exact versions your project actually needs. That means onboarding a new contributor is as simple as sending them the environment you built – install Flox, download the environment, activate it, and start coding.

And if you want to follow along and try this yourself, now’s a good time to sign up for FloxHub – it’s free, and you’ll want an account ready to go by the time we get to the hands-on labs later in the video.

With Flox, you’ll no longer have to manage what’s installed on each person’s machine – you just send them the manifest. And since that manifest gives the developer everything they need, this is exactly why the approach is called “environment as code.”

But it’s not just that – the concept goes a bit deeper, with the mindset of “one tool, every language.” Whether you’re coding in Python, Rust, C++, or any of countless other languages, you can manage every project requirement in one place and it fits at every stage of the SDLC, not on just your laptop.

And although we’ll be starting the hands-on examples shortly, here’s how Flox might fit into your workflow. For each project you manage, you’ll create a manifest listing everything it needs. But that manifest can hold more than just languages and libraries – you can define project directories, environment variables, shell aliases, or have it spin up entire services. Want Redis running alongside your app? Done. Want something like Ollama for local AI? Also done. You can even install tools like Docker Compose or Ansible right into your environment, so every core requirement for your project lives in one place.

And this isn’t just something you use for local development. The software development lifecycle (or “SDLC”) covers the path software takes from development and testing through deployment and production.

If you haven’t heard of the Software Development Live Cycle before, it refers to the path code takes from an idea to something end-users can install and run. During its lifecycle, software passes through a defined series of stages from beginning to end. For example, software gets written, tested, and ultimately released to production. But it doesn’t stop there, as software needs to be maintained and patched over time.

With Flox, the same environment definition can follow the project across those same stages: from a developer’s laptop, into CI, and eventually into production. And it helps with testing too – Flox makes it simple for a developer to pull an environment and start testing.

One of my favorite things about Flox is that it leverages Nix, which sits at the center of NixOS – something I’ve covered earlier on this channel. Nix lets you define how an entire Linux distro should behave and function, and Flox applies that same idea to individual environments.

Nix is a great package manager, but you don’t have to learn it if you’re not already planning on it – Flox doesn’t require you to write any Nix yourself. You get all the reproducibility benefits without the learning curve. I could do a whole follow-up video on how Nix fits in under the hood if there’s interest – but for now, this is good context for those of you who appreciate that kind of detail.

I could talk about Flox all day, but it’s time to get hands-on. Any other features worth mentioning will come up naturally as we go.

Hands-on Lab: Flox in Action

And for our first hands-on lab, let’s get Flox installed and see how that process looks. It depends on your operating system, but you can install it on Mac, Windows, and of course Linux – so that covers just about everyone. You can even run it in a container, which means it’ll work on just about anything with a pulse.

Our focus today is going to be on Linux, since, well, this is a Linux-focused channel. But your dev team might not be running Linux exclusively, so it’s worth touching on the other platforms too.

For Mac users, you can either download the Flox package and install it manually, or use Homebrew if that’s more your style. Either way, it’s about as painless as installing anything else on a Mac.

Windows users can go through WSL – Flox’s website has step-by-step instructions for that process.

But right now, let’s see what installation actually looks like on Linux. My lab server is running AlmaLinux, but Flox also supports Debian-based distros, and even NixOS – which, if you’re into that sort of thing, is pretty cool.

# Download Flox:
wget https://downloads.flox.dev/by-env/stable/deb/flox-1.14.0.x86_64-linux.deb

# Install Flox:
sudo apt install ./flox-1.14.0.x86_64-linux.deb

# Verify installation:
flox --version

Once it’s installed, how do you actually use it? Flox has put together a “Flox in 5 Minutes” project you can grab, which gives you a feel for the whole process.

# Clone the "Flox in 5 Minutes" repo:
git clone https://github.com/flox/flox-in-5min.git

# Go inside the downloaded directory:
cd flox-in-5min

# Activate your Flox environment:
flox activate

# Run the sample Go program that's included in the repo:
go run main.go

And once it’s activated, let’s peek at everything this environment has waiting for us with a quick flox list.

# List the contents of your Flox environment:
flox list

And there you have it – a starter example of Flox in action. We downloaded a pre-existing environment this time, but next, we’ll build one from scratch.

Hands-on Lab: Creating a New Development Environment

Now imagine this scenario: you’re managing a project, and you need to send a build environment to every member of your team. In the old days, people would just follow a sheet of manual setup instructions and hope for the best. But like I mentioned earlier, Flox lets you predefine these environments instead – so let’s see what that actually looks like.

# Create a new directory for your environment:
mkdir sysresources

# Go inside the newly created directory:
cd sysresources

# Initialize a new Flox development environment:
flox init

# Activate your new Flox environment:
flox activate

# Search for a package, such as python:
flox search python

# Install Python:
flox install python314

# Install the psutil package inside your environment:
flox install python313Packages.psutil

Sample Python script (sysresources.py):

This is just a quick, sample Python script that we can use to test our environment. It prints system resource usage though, so it can come in handy:

#!/usr/bin/env python3
"""A simple system resources checker."""

import platform
import time
import psutil


def get_distro_version():
    try:
        with open("/etc/os-release") as f:
            info = dict(line.strip().split("=", 1) for line in f if "=" in line)
        return info.get("PRETTY_NAME", "Unknown").strip('"')
    except FileNotFoundError:
        return platform.platform()


def get_uptime():
    uptime_seconds = time.time() - psutil.boot_time()
    hours, remainder = divmod(uptime_seconds, 3600)
    minutes, _ = divmod(remainder, 60)
    return f"{int(hours)}h {int(minutes)}m"


def main():
    print("System Resources Report")
    print("=" * 30)
    print(f"Distro:        {get_distro_version()}")
    print(f"CPU usage:     {psutil.cpu_percent(interval=1)}%")
    print(f"Memory usage:  {psutil.virtual_memory().percent}%")
    disk = psutil.disk_usage("/")
    print(f"Disk usage:    {disk.percent}% ({disk.used // (1024**3)}GB / {disk.total // (1024**3)}GB)")
    print(f"Process count: {len(psutil.pids())}")
    print(f"Uptime:        {get_uptime()}")


if __name__ == "__main__":
    main()

Then, after reviewing the code feel free to give it a run:

# Run the Python script:
python3 sysresources.py

Hands-on Lab: Pushing Your Environment to Floxhub

If you have a Floxhub Account, you can push your environment there so you can download it onto other machines. If you do have an account, the following commands will show you how that’s done. If you haven’t set up a Floxhub account, you can do so here.

To upload it, from your project directory:

cd /home/jay/sysresources

Authenticate to your Floxhub account:

flox auth login

Follow the browser/login instructions, then push:

flox push

Inside your environment in Floxhub, you’ll find the command you’ll need to download your environment onto another machine..

More Benefits of Using Flox

At this point, we’ve seen some examples of how Flox works, and you might already be thinking about using it to “package” development environments for your project. That alone is immediately useful – but before I wrap up, let’s go over a few other ways Flox can benefit the development process.

And I’ll start with an important one – the Software Bill of Materials, or “SBOM” for short. Depending on where you’re located, this can even be a legal requirement. The basic idea is that a project should have a list identifying every component it uses – like included libraries – so it can be audited later. This helps developers guard against supply chain attacks by keeping a clear record of what’s actually in there. And since your Flox manifest already declares every dependency your environment uses, Flox can generate a complete, accurate SBOM straight from it – no separate scanning process required.

Also, even though we’ve only covered simple examples so far, we’ve barely scratched the surface. Flox can spin up services too, as I mentioned earlier. Need a MariaDB database for your project? Flox can spin one up that won’t conflict with anything else installed on your system – so you can test your code without touching production.

For me personally, my favorite feature is how it abstracts the underlying workstation out of the picture entirely. Before starting my own company, I worked somewhere that developed software, and every engineer had a different setup – some on Ubuntu, a few on Debian, some Mac folks, and a handful of Windows holdouts. Back then, I built a Docker container packed with all our dev tools, and it worked fine – but it also became one more thing I had to maintain. Since most organizations end up with a mix of distros and operating systems, having a reliable, predictable, portable environment takes that whole headache off the table. It even helps when a developer’s workstation needs replacing – hand them a new computer, they install Flox and their environments, and they’re back up and running in no time.

And funny enough, this doesn’t have to stop at your workstation either. That same environment definition can also be activated on your CI runners, or packaged into a container image for production with a single command. So if your team already has a Docker-based deployment pipeline, Flox isn’t asking you to replace it – it just becomes the thing that defines what goes inside it.

And when a vulnerability does show up, you’re not stuck rebuilding and rescanning a pile of container images either – you edit the manifest, push a new version, and that patched environment rolls out everywhere it’s used.