Start Commands

The Start command is the command needed to start your application. It’s a must for any application, whether it’s created with a Nixpack, Buildpack, or Dockerfile. The Start command may differ depending on the application’s language. We’ve provided examples from some common languages below.

Start command from a Nixpack

When an application is created with a Nixpack, we attempt to infer the Start command based on the contents of your application’s repository, or you can specify the Start command in the Resources step when you add the application.

Start command from a Buildpack

When an application is created with a Buildpack, we attempt to infer the Start command based on the contents of your application’s repository, or you can specify the Start command in the Resources step when you add the application.

Start command from a Docker image or Dockerfile

If your application uses a Docker image or Dockerfile to set up your container image, you must specify the ENTRYPOINT or CMD instruction in the Dockerfile to run a container. For more information about how to specify your application’s instructions, see the Dockerfile reference or  Best practices for writing Dockerfiles.

Chaining commands

To add multiple Start commands, use && to chain the commands together like:

command one && command two

View or edit the Start command

Go to Processes > Runtime processes and edit the Web process to change the Start command. The application will automatically deploy with the updated Start command.

Start command language examples

Python

Python

python3 main.py

Django

gunicorn .wsgi

Go

bin/<repo name>

PHP

PHP

heroku-php-apache2

Laravel

heroku-php-apache2 /public
php artisan serve --host 0.0.0.0 --port 8080

Statamic

heroku-php-apache2 public/

Node.js

Node.js

npm start

If you would like to use another command, you need to modify the web process in MyKinsta.

"scripts": {
"start": "node server.js"
},

Node.js with a Dockerfile

When you create the app Kinsta creates a process from the CMD instruction.

CMD ["npm", "run", "start"]

If you change this command in the repository, the process is not changed by default, so you must edit the process in your application’s Processes in MyKinsta.

Ruby

Ruby on Rails

rails server

Ruby on Rails with a Dockerfile

When you first create the application, Kinsta creates a process from the ENTRYPOINT instruction.

ENTRYPOINT ["entrypoint.sh"]

If you change this command in the repository, the process is not changed by default, so you must edit the process in your application’s Processes in MyKinsta.

Java

When you deploy an application, Kinsta automatically creates processes based on the Procfile in the root of the repository.

Scala

target/universal/stage/bin/ -Dhttp.port=$PORT
Was this article helpful?