Skip to main content

Execute Commands

Run a command inside a pod without interactive SSH:
instapod exec my-app -- ls -la /home/instapod/app
instapod exec my-app -- npm install
instapod exec my-app -- python manage.py migrate
The -- separator is required to prevent flag parsing conflicts.

Examples

# Check Node.js version
instapod exec my-app -- node --version

# Install Python dependencies
instapod exec my-app -- /home/instapod/app/venv/bin/pip install -r requirements.txt

# Run a database migration
instapod exec my-app -- php artisan migrate

# Check disk usage
instapod exec my-app -- df -h

SSH Keys

Add an SSH Key

Push your local SSH public key to a pod:
# Use default key (~/.ssh/id_ed25519.pub or ~/.ssh/id_rsa.pub)
instapod ssh-keys add my-app

# Use a specific key file
instapod ssh-keys add my-app --key ~/.ssh/custom_key.pub
This appends the public key to ~/.ssh/authorized_keys inside the pod.

SSH Connection

Once your key is added, connect via SSH:
instapod ssh my-app
Or manually:
ssh [email protected] -p PORT
Find the SSH port on the pod detail page or via:
instapod pods get my-app

SSH Security

InstaPods uses Trust On First Use (TOFU) for SSH host key verification:
  • On first connection, the host key is automatically accepted and saved
  • On subsequent connections, the key is verified against the saved copy
  • If the key changes (which shouldn’t happen for a running pod), you’ll get a warning
When you delete a pod and create a new one, the CLI automatically cleans up the old host key from your ~/.ssh/known_hosts file to prevent conflicts.