All posts

The simplest way to make GitHub Codespaces Longhorn work like it should

Your team spins up a Codespace, needs persistent storage, and something goes sideways. Containers feel disposable, volumes vanish, and everyone swears they saved the config. GitHub Codespaces Longhorn exists so that story stops happening. Codespaces gives every developer a reproducible, cloud-hosted environment tied to your repo. Longhorn, a CNCF project born out of Rancher Labs, turns Kubernetes storage into something durable, managed, and snapshot-ready. Together they offer stable dev environ

Free White Paper

GitHub Actions Security + End-to-End Encryption: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

Your team spins up a Codespace, needs persistent storage, and something goes sideways. Containers feel disposable, volumes vanish, and everyone swears they saved the config. GitHub Codespaces Longhorn exists so that story stops happening.

Codespaces gives every developer a reproducible, cloud-hosted environment tied to your repo. Longhorn, a CNCF project born out of Rancher Labs, turns Kubernetes storage into something durable, managed, and snapshot-ready. Together they offer stable dev environments on real infrastructure without forcing ops to babysit disks.

Longhorn attaches persistent volumes to the Kubernetes pods running your Codespaces backends. Under the hood, it replicates data blocks across nodes, handles self-healing, and enables instant rollbacks when a container gets messy. With proper configuration, every Codespace launch can mount a Longhorn volume, ensuring code history, dependency caches, and debugging traces survive teardown.

The setup uses GitHub’s OIDC-based identity flow to authenticate the workspace, then applies service account permissions in Kubernetes for volume access. Longhorn volume claims pair directly with the workspace pod identity, enforcing isolation between developers while maintaining shared images where you want them. Keep RBAC tight: map users in Okta or AWS IAM to namespaces so storage doesn’t cross projects or compliance lines.

If Longhorn throws volume attach errors, usually it’s an outdated CSI driver or a leftover volume claim. Cleaning those mappings before redeploy fixes most issues. For storage snapshots, set schedules and retention using Longhorn’s own policies rather than external scripts. Built-in consistency beats custom automation every time.

Continue reading? Get the full guide.

GitHub Actions Security + End-to-End Encryption: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Key benefits:

  • Continuous workspace data persistence across Codespace sessions
  • Reduced rebuild time and faster onboarding for new developers
  • Automated volume replication for better resilience
  • Direct Kubernetes integration for transparent storage policies
  • Built-in snapshots that simplify audit and rollback workflows

A developer workflow feels sharper when the environment remembers what you did. With Longhorn under Codespaces, caching dependencies and saving state becomes almost trivial. Less context-switching, fewer mysterious missing files, and no waiting for someone to “rebuild the environment again.” Debugging remains in-flow instead of in Slack threads.

Platforms like hoop.dev turn those access rules into guardrails that enforce policy automatically. Combine hoop.dev’s identity-aware proxy with Longhorn’s persistent storage and you have a reproducible, secured workspace that nobody needs to babysit. SOC 2 checks pass more easily, environments stay consistent, and storage scale curves upward without drama.

How do I connect GitHub Codespaces and Longhorn?
Create a Kubernetes cluster accessible from your Codespace runtime, install Longhorn, and attach persistent volumes via your workspace’s devcontainer specification. The identity layer handles permissions. Once configured, every new Codespace gets the same durable storage bindings as the last.

The simplest insight: GitHub Codespaces Longhorn is not magic, just smart engineering. Persistent compute plus reliable storage makes developers faster, and teams calmer.

See an Environment Agnostic Identity-Aware Proxy in action with hoop.dev. Deploy it, connect your identity provider, and watch it protect your endpoints everywhere—live in minutes.

Get started

See hoop.dev in action

One gateway for every database, container, and AI agent. Deploy in minutes.

Get a demoMore posts