Deploy code to your pod by connecting a GitHub repository or any Git URL. Push to a branch and your code deploys automatically — with dependency installation, build commands, and deployment history.
Quick Start
# Create a pod
instapods pods create my-api --preset nodejs -w
# Connect a GitHub repo and trigger the first deploy
instapods git connect my-api --repo https://github.com/you/my-api --deploy
# That's it. Push to main and it auto-deploys.
Connecting a Repository
GitHub Repository
# Connect and deploy immediately
instapods git connect my-app --repo https://github.com/you/repo --deploy
# Connect to a specific branch
instapods git connect my-app --repo https://github.com/you/repo --branch develop
# Connect a private repo with a personal access token
instapods git connect my-app \
--repo https://github.com/you/private-repo \
--auth-token ghp_your_token_here \
--deploy
- Go to your pod’s Git tab
- Enter the repository URL (e.g.,
https://github.com/you/repo)
- Select the branch to deploy from (default:
main)
- Click Connect
curl -X POST https://app.instapods.com/api/pods/my-app/git \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"repo_url": "https://github.com/you/repo",
"branch": "main",
"auto_deploy": true
}'
Any Git URL
You can connect any publicly accessible Git repository:
instapods git connect my-app --repo https://gitlab.com/you/repo
instapods git connect my-app --repo https://bitbucket.org/you/repo
For private repositories, provide an auth token:
instapods git connect my-app \
--repo https://gitlab.com/you/private-repo \
--auth-token glpat-your_token_here
Auto-Deploy on Push
When a repository is connected with auto-deploy enabled (the default), pushing to the configured branch triggers a deployment automatically.
For GitHub repositories, InstaPods sets up a webhook that fires on every push. For other Git providers, you can configure a webhook manually using the URL shown in the dashboard.
How a Deploy Works
- Pull — The latest code is pulled from the configured branch
- Install — Dependencies are installed based on the preset (see below)
- Build — Build commands run if configured
- Restart — The application service restarts with the new code
The entire process typically takes 5-30 seconds depending on the size of your dependencies.
Skip a Deploy
Add [skip deploy] to your commit message to push without triggering a deployment:
git commit -m "update readme [skip deploy]"
git push
Build Auto-Detection
InstaPods uses AI to analyze your project files and automatically determine the right install, build, and start commands for each deploy. This works for all presets and handles frameworks like Next.js, Vite, Django, Laravel, and more — without any configuration.
The AI inspects files like package.json, requirements.txt, composer.json, framework configs, and your directory structure. It detects:
- Install commands —
npm install, pip install -r requirements.txt, composer install, etc.
- Build commands —
npm run build, framework-specific builds
- Start commands —
node server.js, serve -s build, gunicorn app:app, etc.
- App port — The port your app listens on
If AI detection is unavailable, InstaPods falls back to these defaults:
| Preset | Install Command | Build Command |
|---|
| Node.js | npm install | npm run build (if build script exists) |
| Python | pip install -r requirements.txt | None |
| PHP | composer install | None |
| Static | None | None |
The AI auto-detection handles SPAs and frameworks that need a custom start command (e.g., serve -s build for Vite, node server.js for Next.js standalone). You don’t need to configure these manually.
Custom Commands
Override the defaults with a custom build command:
# Set a custom build command during connect
instapods git connect my-app \
--repo https://github.com/you/repo \
--build-cmd "npm ci && npm run build"
# Update the build command later
instapods git connect my-app \
--repo https://github.com/you/repo \
--build-cmd "yarn install --frozen-lockfile && yarn build"
curl -X PUT https://app.instapods.com/api/pods/my-app/git \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"build_command": "npm ci && npm run build",
"auto_deploy": true
}'
Check Git Status
See the current git configuration and last deployment status:
instapods git status my-app
Output shows the connected repo, branch, auto-deploy setting, and latest deployment info.curl https://app.instapods.com/api/pods/my-app/git \
-H "Authorization: Bearer YOUR_TOKEN"
Returns null if no repository is connected.
Manual Deploy
Trigger a deployment manually, even if auto-deploy is off:
# Trigger and return immediately
instapods git deploy my-app
# Wait for the deploy to finish
instapods git deploy my-app -w
# Wait with custom timeout
instapods git deploy my-app -w --timeout 300s
curl -X POST https://app.instapods.com/api/pods/my-app/git/deploy \
-H "Authorization: Bearer YOUR_TOKEN"
Deployment History and Logs
Every deployment is recorded with its status, commit, and build output.
View Deployments
# Last 10 deployments (default)
instapods git deployments my-app
# Last 25 deployments
instapods git deployments my-app -n 25
curl "https://app.instapods.com/api/pods/my-app/git/deployments?limit=10" \
-H "Authorization: Bearer YOUR_TOKEN"
View Build Logs
# Logs from the latest deployment
instapods git logs my-app
# Logs from a specific deployment
instapods git logs my-app deploy_abc123
curl https://app.instapods.com/api/pods/my-app/git/deployments/deploy_abc123 \
-H "Authorization: Bearer YOUR_TOKEN"
The response includes a build_log field with the full output.
Rollback
Revert to a previous deployment:
# Rollback to the previous deployment
instapods git rollback my-app
# Rollback to a specific deployment
instapods git rollback my-app deploy_abc123
# Skip confirmation and wait for completion
instapods git rollback my-app -f -w
curl -X POST https://app.instapods.com/api/pods/my-app/git/rollback \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"deployment_id": "deploy_abc123"}'
Omit deployment_id to roll back to the immediately previous deployment.
GitHub Commit Status Checks
When deploying from a GitHub repository, InstaPods reports deployment status back to GitHub as commit status checks. You’ll see a green checkmark (or red X) on your commits and pull requests.
This works automatically for public repositories. For private repositories, make sure the auth token you provided has repo:status scope.
Disconnect
Remove the git connection from a pod:
# With confirmation prompt
instapods git disconnect my-app
# Skip confirmation
instapods git disconnect my-app -f
curl -X DELETE https://app.instapods.com/api/pods/my-app/git \
-H "Authorization: Bearer YOUR_TOKEN"
Disconnecting removes the webhook and git configuration. Your deployed code stays in the pod — nothing is deleted.
Full Example
Deploy a Node.js API from GitHub with auto-deploy:
# 1. Create the pod
instapods pods create my-api --preset nodejs --plan build -w
# 2. Set environment variables
instapods exec my-api -- "cat > /home/instapod/app/.env << 'EOF'
DATABASE_URL=postgres://instapod:secret@localhost:5432/instapod
NODE_ENV=production
EOF"
# 3. Install a database
instapods services add my-api -s postgresql -w
# 4. Connect the repo (triggers first deploy)
instapods git connect my-api --repo https://github.com/you/my-api --deploy
# 5. Check deployment status
instapods git status my-api
# From now on, every push to main auto-deploys.
# View deployment history anytime:
instapods git deployments my-api