This guide walks you through setting up Podman as a Docker alternative on macOS for Supabase development. Podman is a daemonless container engine that's compatible with Docker commands and provides enhanced security.
- macOS (Intel or Apple Silicon)
- Homebrew package manager installed
- Terminal access
- Basic familiarity with command line operations
Podman offers several advantages over Docker:
- Daemonless architecture: No background daemon required
- Rootless containers: Enhanced security by running without root privileges
- Docker compatibility: Drop-in replacement for Docker commands
- Lightweight: Lower resource usage compared to Docker Desktop
Install Podman, Podman Desktop (GUI), and Podman Compose using Homebrew:
brew install podman podman-desktop podman-composeWhat this installs:
podman: The core container enginepodman-desktop: Optional GUI for managing containerspodman-compose: Docker Compose compatibility layer
Podman on macOS requires a virtual machine to run Linux containers. Initialize it:
podman machine initWhat happens:
- Downloads a lightweight Linux VM image
- Configures the VM for container operations
- Sets up networking and storage
Common options:
--cpus 4: Set number of CPU cores (default: 1)--memory 4096: Set memory in MB (default: 2048)--disk-size 50: Set disk size in GB (default: 10)
Example with custom resources:
podman machine init --cpus 4 --memory 4096 --disk-size 50Start the Podman virtual machine:
podman machine startVerification: Check if the machine is running:
podman machine listYou should see output similar to:
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
podman-machine-default* qemu 2 hours ago Currently running 1 2.147GB 10.74GB
For Supabase CLI compatibility, set up Docker socket emulation:
export DOCKER_HOST=unix:///var/run/docker.sockMake it permanent:
Add this to your shell profile (~/.zshrc for zsh or ~/.bash_profile for bash):
echo 'export DOCKER_HOST=unix:///var/run/docker.sock' >> ~/.zshrc
source ~/.zshrcAlternative method: You can also create an alias for docker commands:
alias docker=podmanPodman Desktop provides a GUI interface and is required for the Supabase CLI to properly detect the Docker daemon. Start and configure it:
-
Start the application:
- Open Launchpad or Applications folder
- Launch "Podman Desktop"
- Or use Spotlight:
Cmd + Space, then type "Podman Desktop"
-
Alternative command line launch:
open -a "Podman Desktop"
Critical Step: Enable Docker compatibility in Podman Desktop for Supabase CLI to work properly.
-
Open Preferences:
- Click on "Podman Desktop" in the menu bar
- Select "Preferences" or use
Cmd + ,
-
Navigate to Docker Compatibility:
- Click on "Preferences" or "Settings" tab
- Look for "Docker Compatibility" or "Docker" section
-
Enable Docker Socket:
- Check "Enable Docker socket compatibility"
- Check "Start Docker API on Podman machine start"
- Check "Docker compatibility mode"
-
Apply Settings:
- Click "Apply" or "Save"
- The application may prompt to restart the Podman machine
-
Check Dashboard:
- You should see your Podman machine listed as "Running"
- The status should show green indicators
-
Verify Docker socket:
ls -la /var/run/docker.sock
This should show the Docker socket is available.
-
Test Docker compatibility:
docker version
This should return Podman version information without errors.
Important: Keep Podman Desktop running in the background while developing with Supabase. The Supabase CLI requires the Docker daemon detection that Podman Desktop provides.
- Podman Desktop can run minimized to the system tray
- It will automatically start the Podman machine when needed
- You can set it to start automatically at login in Preferences
Install the Supabase CLI using Homebrew:
brew install supabase/tap/supabaseVerify installation:
supabase --versionNavigate to your project directory and initialize Supabase:
cd /path/to/your/project
supabase initWhat this creates:
supabase/directory with configuration filessupabase/config.toml: Main configuration filesupabase/seed.sql: Database seed file- Various migration and function directories
Start the local Supabase development environment:
supabase startWhat happens:
- Downloads required Docker images (PostgreSQL, PostgREST, etc.)
- Starts all Supabase services in containers
- Sets up local database with default schema
- Provides local URLs for API and Dashboard
Expected output:
Started supabase local development setup.
API URL: http://localhost:54321
GraphQL URL: http://localhost:54321/graphql/v1
DB URL: postgresql://postgres:postgres@localhost:54322/postgres
Studio URL: http://localhost:54323
Inbucket URL: http://localhost:54324
JWT secret: super-secret-jwt-token-with-at-least-32-characters-long
anon key: [long-jwt-token]
service_role key: [long-jwt-token]
Issue: Machine fails to start or shows connection errors.
Solutions:
-
Check if virtualization is enabled:
sysctl kern.hv_support
Should return
kern.hv_support: 1 -
Restart the machine:
podman machine stop podman machine start
-
Recreate the machine:
podman machine rm podman machine init podman machine start
Issue: Supabase CLI shows "Cannot connect to Docker daemon" errors.
Solutions:
-
Ensure Podman Desktop is running:
- Check that Podman Desktop is open and the machine shows as "Running"
- Verify Docker compatibility is enabled in Podman Desktop preferences
-
Ensure DOCKER_HOST is set:
echo $DOCKER_HOST
-
Create Docker socket link (if needed):
sudo ln -sf /var/run/podman/podman.sock /var/run/docker.sock
-
Use Podman directly:
alias docker=podman -
Restart Podman Desktop:
- Quit Podman Desktop completely
- Restart the application
- Wait for the machine to show "Running" status
Issue: Supabase services fail to start due to port conflicts.
Solutions:
-
Check what's using the ports:
lsof -i :54321 lsof -i :54322 lsof -i :54323
-
Stop conflicting services or change Supabase ports in
supabase/config.toml
Issue: Containers run slowly or consume too much memory.
Solutions:
-
Increase VM resources:
podman machine stop podman machine rm podman machine init --cpus 4 --memory 4096 podman machine start
-
Prune unused containers and images:
podman container prune podman image prune
# List machines
podman machine list
# Stop machine
podman machine stop
# SSH into machine
podman machine ssh
# Remove machine
podman machine rm# List running containers
podman ps
# View logs
podman logs <container-name>
# Stop all containers
podman stop $(podman ps -q)
# Remove all containers
podman rm $(podman ps -aq)# Stop Supabase services
supabase stop
# Reset database
supabase db reset
# Generate TypeScript types
supabase gen types typescript --local
# View logs
supabase logs-
Resource Allocation: Allocate sufficient CPU and memory to the Podman machine based on your project needs.
-
Regular Updates: Keep Podman and Supabase CLI updated:
brew upgrade podman supabase
-
Clean Up: Regularly clean up unused containers and images to free up disk space.
-
Environment Variables: Use a
.envfile for project-specific environment variables. -
Version Control: Add
supabase/.temp/to your.gitignorefile.
- Explore the Supabase Studio at
http://localhost:54323 - Set up your database schema using migrations
- Configure authentication and RLS policies
- Integrate with your frontend application
This guide was created for macOS users looking to use Podman as a Docker alternative for Supabase development. For Docker-specific setup, refer to the official Supabase documentation.