puma(1)

fast, concurrent web server for ruby and rack

Section 1 puma bookworm source

Description

PUMA

NAME

puma - fast, concurrent web server for ruby and rack

USAGE

puma [options...] [rackup file]

puma [-h | --help | -V | --version]

OPTIONS

The following options are available:
-b, --bind
URI

URI to bind to (tcp://, unix://, ssl://).

-C, --config PATH

Load given path as a config file.

--control URL

DEPRECATED alias for --control-url.

--control-token TOKEN

The TOKEN to use as authentication for the control server.

--control-url URL

The bind URL to use for the control server and app. Use auto to use a temp unix server. This requires to use a --control-token, which needs to be given with every request to the control server (token=foo).

-d, --daemon

Demonize the server into the background.

--debug

Show low level debugging information.

--dir DIR

Change to given directory before starting.

-e, --environment ENVIRONMENT

The environment to run the Rack app on. Default development.

-I, --include PATH

Specify $LOAD_PATH directories.

-p, --port PORT

Define the TCP port to bind to. Use -b for more advanced options.

--pidfile PATH

Use the given path as PID file.

--preload

Preload the application. This loads all the application code prior to forking. Preloading reduces total memory usage of an application and is only available in cluster mode.

--prune-bundler

Prune out the bundler env if possible.

-q, --quiet

Do not log requests internally. Default: true.

-v, --log-requests

Log requests as they occur.

-R, --restart-cmd CMD

The puma command to run during a hot restart. Default: inferred.

-S, --state PATH

Where to store the state details.

-t, --threads INT

Min:max threads to use. Puma will automatically scale the number of threads, from the minimum until it caps out at the maximum, based on how much traffic is present. Default: 0:16.

--tcp-mode

Run the app in raw TCP mode instead of HTTP mode.

--early-hints

Enable early hints support.

-w, --workers COUNT

Activate cluster mode and define number of worker processes to create. In this mode workers are forked from a master process. Each child process still has its own thread pool and the -t setting is per worker.

--tag NAME

Additional text to display in process listing.

--redirect-stdout FILE

Redirect STDOUT to a specific file.

--redirect-stderr FILE

Redirect STDERR to a specific file.

--[no-]redirect-append

Append to redirected files.

-h, --help

Show help.

-V, --version

Print the version information.

EXAMPLES

The following examples show how to bind TCP or sockets:

Bind Puma to a socket with the -b (or --bind) flag:

puma -b tcp://127.0.0.1:9292

To use a UNIX Socket instead of TCP:

puma -b unix:///var/run/puma.sock

To change the permissions of the UNIX socket, add a umask parameter:

puma -b ’unix:///var/run/puma.sock?umask=0111’

In need of a bit of security use SSL sockets:

puma -b ’ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert’

The following example show how to Create a control server and use pumactl(1) to interact with the control server to restart puma.

puma --control-url tcp://127.0.0.1:9293 --control-token foo
pumactl --control-url ’tcp://127.0.0.1:9293’ --control-token foo restart

CONFIGURATION FILE

puma will look for a configuration file at config/puma.rb. If an environment is specified, either via the -e and --environment flags, or through the RACK_ENV or the RAILS_ENV environment variables, it looks for configuration at config/puma/<environment_name>.rb.

The -C flag allows one to pass on a custom configuration location. If the value specified is a dash (-) puma won’t look for any configuration file:

puma -C "-"

SEE ALSO

There is extensive documentation at <https://puma.io/puma/> and <- https://github.com/puma/puma>.

AUTHOR

This manual page was written by Daniel Leidert <dleidert@debian.org>, for the Debian GNU/Linux system (but may be used by others).