Skip to content

Shell Scripts

Railpack can deploy applications that use shell scripts as their entry point.

Your project will be automatically detected as a shell script application if any of these conditions are met:

  • A start.sh script exists in the root directory
  • The RAILPACK_SHELL_SCRIPT environment variable is set to a valid script file

Create a shell script in your project root (e.g., start.sh):

#!/bin/bash
echo "Hello world..."

Railpack automatically detects which shell interpreter to use by reading the shebang line in your script. The following shells are supported:

ShellShebang ExampleNotes
bash#!/bin/bashAvailable in base image
sh#!/bin/shAvailable in base image
dash#!/bin/dashAvailable in base image (uses sh)
zsh#!/bin/zshAutomatically installed

If no shebang is present, sh is used as the default.

Non-POSIX shells like fish, mksh, and ksh cannot be automatically detected and will fall back to bash. If you need to use these shells, you may need to install them manually in your script or use a supported shell.

VariableDescriptionExample
RAILPACK_SHELL_SCRIPTSpecify a custom shell script to executedeploy.sh