GitHub Codespaces — free 60 hours per month for cloud dev environments
How to use GitHub Codespaces free tier as a full VSCode-in-browser development environment. Setup, limits, and practical workflows.
GitHub Codespaces gives every free GitHub account 60 hours per month of free cloud-hosted VSCode. Full development environment, real terminal, works from any device. No local install required.
Here is how to use it effectively.
What Codespaces actually provides
Every Codespace includes:
- Full VSCode running in your browser
- 2-core CPU + 8GB RAM (default machine size)
- 32 GB storage
- Full Ubuntu terminal
- Docker installed and working
- Git pre-configured with your GitHub identity
- Ability to install any language, tool, package
Essentially, a Linux VM with VSCode as the UI — accessed from any browser.
Free tier limits
- 120 core-hours/month (which equals 60 real hours on the default 2-core machine, or 30 real hours on a 4-core machine)
- 15 GB/month of storage
- Reset on the 1st of each month
- Personal accounts only (organizations may have different limits)
If exceeded, additional usage is billed at ~$0.18/hour for 2-core.
Getting started
Prerequisite: any GitHub account (free tier works).
From an existing repository
- Go to any GitHub repo (yours or forked)
- Click green “Code” button
- Select “Codespaces” tab
- Click “Create codespace on main”
- Wait 60-90 seconds for environment to boot
- VSCode opens in your browser with the repo already cloned
From scratch
- Go to https://github.com/codespaces
- Click “New codespace”
- Pick a blank template or a language template
- Codespace boots
Practical workflows
Learning a new framework
Try Astro, Next.js, or any framework without local install:
- Fork the framework’s starter repo
- Open in Codespaces
- All dependencies auto-install
- Run
npm run devin Codespace terminal - Codespaces auto-forwards the port to a public URL
- Test in browser
Zero pollution of your local machine.
Testing on Linux from Windows/Mac
Codespaces provides a real Linux environment. Perfect for:
- Testing shell scripts that require bash
- Running Docker (some Windows setups struggle with Docker)
- Trying Linux-only tools
- Verifying app works cross-platform before deployment
Working from an iPad or Chromebook
Full development environment on any device with a browser. Have written articles from an iPad using only Codespaces.
Limitations: some VSCode features (like heavy debugging) work better on desktop, but for editing and testing, tablets work fine.
Emergency access from anywhere
Laptop dies before a deadline? Log into GitHub from any computer, open your Codespace, continue where you left off. All work syncs via git.
Contributing to open source
Fork a repo, open in Codespaces, make changes, submit PR. No need to configure the project’s specific environment (Ruby version, Python version, database) on your machine.
Configuring your environment
Personal customization
Create .devcontainer/devcontainer.json in any repo to customize:
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/node:1": { "version": "20" },
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postCreateCommand": "npm install",
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
}
}
Now Codespaces created from this repo automatically:
- Uses Ubuntu base
- Installs Node 20 and Docker
- Runs
npm installafter boot - Loads Prettier and ESLint extensions
Dotfiles (personal preferences)
Configure your personal shell, git, and editor preferences that apply to every Codespace you create:
- Create a public repo named
dotfilesin your GitHub account - Add your
.bashrc,.gitconfig,.vimrc, etc. - GitHub Settings → Codespaces → Enable “Automatically install dotfiles”
Now every Codespace starts with your personal configuration.
Common Codespaces gotchas
Machine goes to sleep after 30 min of inactivity
Default idle timeout is 30 minutes. Change in Settings → Codespaces → Default idle timeout (up to 240 min).
When it sleeps, your work is preserved. Restarting takes ~10 seconds to wake back up.
Codespaces expire after 30 days of no use
Auto-deleted after 30 days of inactivity. Change retention in Settings.
Committed but not pushed = risk of loss
If Codespace is deleted, uncommitted work is gone. Habit: git push frequently.
Port forwarding sometimes shows “site not found” briefly
After starting a dev server, port forwarding needs a few seconds. Refresh if it doesn’t load immediately.
Codespaces vs alternatives
| Tool | Free tier | Best for |
|---|---|---|
| GitHub Codespaces | 60 hrs/month | GitHub users, VSCode fans |
| Gitpod | 50 hrs/month | Similar to Codespaces, more customization |
| Replit | Unlimited (with limits) | Quick experiments, multiple languages |
| StackBlitz | Unlimited (browser-only) | Frontend/JS, no Docker |
| CodeSandbox | Free tier | React/Vue projects, live sharing |
Codespaces vs Gitpod: nearly identical products. Codespaces has tighter GitHub integration. Gitpod supports GitLab and Bitbucket too.
Codespaces vs Replit: Replit is faster for quick experiments but less powerful for full projects. Codespaces is a real VM.
Codespaces vs StackBlitz: StackBlitz is browser-only (no Docker, no shell). Faster but limited. Codespaces is full Linux.
When to use Codespaces vs local dev
Codespaces wins when:
- Working from multiple devices
- Corporate laptop restrictions block local installs
- Testing on Linux from Windows/Mac
- Onboarding to a new project (skip environment setup)
- Contributing to open source
- Occasional coding sessions
Local dev wins when:
- Full-time development on one machine
- Need heavy resources (>8GB RAM, GPU)
- Working offline frequently
- Sensitive projects requiring air-gapped setup
- Personal preference for local files
Many developers use both — local as primary, Codespaces for specific tasks.
Reproduce this yourself
Right now:
- Log into https://github.com
- Go to any public repo (try https://github.com/withastro/astro)
- Click green “Code” → “Codespaces” tab
- Click “Create codespace”
- Wait 60-90 seconds
- VSCode opens in browser
Try:
node --version
docker --version
npm install
npm run build
Full dev environment. Nothing installed on your machine.
Managing your usage
Track usage: https://github.com/settings/billing → “Codespaces”
To stay within free tier:
- Use 2-core machines (default) — 120 core-hours = 60 real hours
- Turn on aggressive idle timeout (15-30 min)
- Delete unused Codespaces manually
- Use
.devcontainerconfig so environments boot fast (less runtime waste)
60 real hours/month on a 2-core machine is enough for most part-time or hobby projects.
Bottom line
GitHub Codespaces free tier is one of the most generous cloud IDE offerings in 2026. 120 core-hours/month (60 real hours on a 2-core machine) means real usable development capacity for free.
Perfect for:
- Trying new frameworks
- Testing on Linux
- Working from multiple devices
- Contributing to open source
- Corporate laptop restrictions
Not a full replacement for local dev on high-usage projects. Use as a complementary tool.
DevOps YAML Pack
36 production-ready configs — Kubernetes, Docker Compose, GitHub Actions, Terraform, Helm, Ansible. Every file heavily commented. Copy, paste, ship.
Get the pack — ₹499 →