Skip to content

Run One-Off Commands

One-off commands let you execute arbitrary commands inside your application's container without deploying. They run with the same code, environment variables, and dependencies as your application.

Running a Command

  1. Go to your application in the dashboard
  2. Navigate to Application Settings > Run Command
  3. Enter the command you want to execute
  4. Click Run

The command output is displayed in the dashboard as it runs.

Common Use Cases

Django Management Commands

python manage.py createsuperuser
python manage.py collectstatic --noinput
python manage.py shell

Database Migrations

python manage.py migrate
rails db:migrate
npx prisma migrate deploy

Debugging

python -c "import django; print(django.VERSION)"
node -e "console.log(process.env.DATABASE_URL)"
cat /etc/os-release

Data Tasks

python manage.py loaddata fixtures/initial.json
python manage.py clear_cache

How It Works

One-off commands run in a new container instance that is created from the same Docker image as your deployed application. The container:

  • Has the same environment variables as your running processes
  • Has the same code and installed dependencies
  • Has access to the same volumes (if any are attached)
  • Stops when the command completes

How the Command Text Is Read

On an application on a single server, the complete command runs inside the container, also when it contains shell characters such as &&, |, >, ;, $ or quotes:

  • A plain command contains only words of letters, digits and the characters _ @ % + = : , . / -, separated by spaces. For example python manage.py migrate. Appliku passes it to the container as its words.
  • Any other command runs in a shell in the container: bash if the image has it, else /bin/sh. Thus python manage.py migrate && python manage.py collectstatic --noinput runs both commands in the container, and in echo $DATABASE_URL the variable gets its value from the container.

The same applies to cron jobs. Before November 2026, the shell of the server read these characters, so the part after && or | ran on the server.

Cluster Mode

In cluster mode, the leader node of your Docker Swarm cluster starts the command as a temporary Swarm service with one task. Swarm runs that task on one node of the cluster. When the cluster has worker nodes and the application does not allow placement on manager nodes, the task runs on a worker node.

Notes

  • Long-running commands may time out. For recurring tasks, use cron jobs instead.
  • One-off commands do not trigger a deployment or restart your running processes.
  • The command runs with the image from your most recent successful deployment.