FOREMAN(1)
π FOREMAN(1) β the Foreman Manual, but make it a group chat π
okay bestie, sit down, hydrate, and let me tell you about foreman β the little command that manages your Procfile-based applications. the whole vibe is: we hide all the Procfile-format drama from you, so you can either run your app directly or export it into some other process management format. literally that's the entire personality. β¨
β¨ SYNOPSIS β¨
foreman start [process]
foreman run <command>
foreman export <format> [location]
that's it. three whole modes. iconic behavior honestly. π
πΈ DESCRIPTION πΈ
So. Foreman is a manager for Procfile-based applications. Its aim is to abstract away the details of the Procfile format, and allow you to either run your application directly, or export it to some other process management format.
that's the pitch. that's the whole pitch. and it ate. π«Ά
π₯ RUNNING π₯
foreman start is what you use to run your application directly from the command line. no middleman, no ceremony, just vibes and processes.
- If no additional parameters are passed, foreman will run one instance of each type of process defined in your Procfile.
- If a parameter is passed, foreman will run one instance of the specified application type. just the one. she's picky like that.
The following options control how the application is run:
-m,--formationβ Specify the number of each process type to run. The value passed in should be in the formatprocess=num,process=num-e,--envβ Specify one or more.envfiles to load-f,--procfileβ Specify an alternate Procfile to load, implies-dat the Procfile root.-p,--portβ Specify which port to use as the base for this application. Should be a multiple of1000.-t,--timeoutβ Specify the amount of time (in seconds) processes have to shutdown gracefully before receiving aSIGKILL, defaults to5.
ok so that last one? SIGKILL? that's the "no more mr. nice guy" signal. after your timeout runs out she stops asking politely. π
And then there's foreman run β that one is used to run one-off commands using the same environment as your defined processes. same env, no commitment. π
π¦ EXPORTING π¦
foreman export is used to export your application to another process management format. she's helping you move out and get your own place. π§
A location to export can be passed as an argument. This argument may be either required or optional depending on the export format. (iykyk β check your format's docs, bestie.)
The following options control how the application is run:
-a,--appβ Use this name rather than the application's root directory name as the name of the application when exporting.-m,--formationβ Specify the number of each process type to run. The value passed in should be in the formatprocess=num,process=num-l,--logβ Specify the directory to place process logs in.-p,--portβ Specify which port to use as the base for this application. Should be a multiple of1000.-t,--templateβ Specify an alternate template to use for creating export files. Seehttps://github.com/ddollar/foreman/tree/master/data/exportfor examples.-u,--userβ Specify the user the application should be run as. Defaults to the app name
π GLOBAL OPTIONS π
These options control all modes of foreman's operation. the everywhere-everything options. π
-d,--rootβ Specify an alternate application root. This defaults to the directory containing the Procfile.-e,--envβ Specify an alternate environment file. You can specify more than one file by using:--env file1,file2.-f,--procfileβ Specify an alternate location for the application's Procfile. This file's containing directory will be assumed to be the root directory of the application.
π EXPORT FORMATS π
foreman currently supports the following output formats:
bluepillinittablaunchdrunitsupervisordsystemdupstart
seven of them. a whole little menu. pick your fighter. β
π INITTAB EXPORT π
Will export a chunk of inittab-compatible configuration:
# ----- foreman example processes -----
EX01:4:respawn:/bin/su - example -c 'PORT=5000 bundle exec thin start >> /var/log/web-1.log 2>&1'
EX02:4:respawn:/bin/su - example -c 'PORT=5100 bundle exec rake jobs:work >> /var/log/job-1.log 2>&1'
# ----- end foreman example processes -----
look at that. a whole chunk. she did that. π
π SYSTEMD EXPORT π
Will create a series of systemd scripts in the location you specify. Scripts will be structured to make the following commands valid:
systemctl start appname.target
systemctl stop appname-processname.target
systemctl restart appname-processname-3.service
π UPSTART EXPORT π
Will create a series of upstart scripts in the location you specify. Scripts will be structured to make the following commands valid:
start appname
stop appname-processname
restart appname-processname-3
π PROCFILE π
A Procfile should contain both a name for the process and the command used to run it.
web: bundle exec thin start
job: bundle exec rake jobs:work
A process name may contain letters, numbers and the underscore character. You can validate your Procfile format using the check command:
$ foreman check
The special environment variables $PORT and $PS are available within the Procfile. $PORT is the port selected for that process. $PS is the name of the process for the line.
The $PORT value starts as the base port as specified by -p, then increments by 100 for each new process line. Multiple instances of the same process are assigned $PORT values that increment by 1.
no cap, that+100vs+1distinction trips people up ALL the time. write it down. π«Ά
π ENVIRONMENT π
If a .env file exists in the current directory, the default environment will be read from it. This file should contain key/value pairs, separated by =, with one key/value pair per line.
FOO=bar
BAZ=qux
β DEFAULT OPTIONS β
If a .foreman file exists in the current directory, default options will be read from it. This file should be in YAML format with the long option name as keys. Example:
formation: alpha=0,bravo=1
port: 15000
so like formation: not -m, okay? long names only. she's specific. π
π₯ EXAMPLES π₯
Start one instance of each process type, interleave the output on stdout:
$ foreman start
Export the application in upstart format:
$ foreman export upstart /etc/init
Run one process type from the application defined in a specific Procfile:
$ foreman start alpha -f ~/myapp/Procfile
Start all processes except the one named worker:
$ foreman start -m all=1,worker=0
that last one is the classic. worker=0? she said not today. πβ¨
π COPYRIGHT π
Foreman is Copyright (C) 2010 David Dollar http://daviddollar.org
ok that's the whole page bestie, you're officially a foreman girlie now π π¦β¨
this was Foreman 0.90.0, from July 2025, and that's on periodt. π go run your processes, queen π
π¦ where this page comes from
- ubuntu resolute: ruby-foreman 0.90.0-1 Β· MIT
- ubuntu stonking: ruby-foreman 0.90.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms