PUMA(1)

πŸ“¦
version 8.0.2 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ PUMA β€” like, the manual page bestie ✨

puma β€” a fast, concurrent web server for ruby and rack πŸ’– (yes that's the NAME section, we're doing this properly)


πŸ¦‹ USAGE πŸ¦‹

okay so here's the shape of it:

puma [options...] [rackup file]
puma [-h | --help | -V | --version]

that's it. that's the whole vibe check. πŸ‘‘


πŸ’… OPTIONS πŸ’…

The following options are available (all of them, bestie, I'm not skipping a single one):

  • -b, --bind URI β€” the URI you wanna bind to, like tcp://, unix://, ssl://. 🫢
  • -C, --config PATH β€” load that path as a config file. give it the path, it does the thing.
  • --control URL β€” DEPRECATED alias for --control-url. it's giving legacy, ngl. πŸ™ˆ
  • --control-token TOKEN β€” the TOKEN used as authentication for the control server.
  • --control-url URL β€” the bind URL for the control server and app. use auto to use a temp unix server. this requires you to use a --control-token, which needs to be given with every request to the control server (token=foo). no token no entry, periodt.
  • -d, --daemon β€” demonize the server into the background. go girl give us nothing (visually, she's running in the back) πŸ’€
  • --debug β€” show low level debugging information. the tea β˜•
  • --dir DIR β€” change to the 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, iykyk.
  • --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. the receipts! 🧾
  • -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. she scales, she adapts, main character energy fr fr πŸ”₯
  • --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. we love a helpful icon πŸ’–
  • -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

like… she's literally controlling herself through a whole other command. iconic. 🌈


πŸŽ€ 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 "-"
so like, -C "-" = no config, we're going in raw. 🫣

🧚 SEE ALSO 🧚

There is extensive documentation at <https://puma.io/puma/> and <https://github.com/puma/puma>. go read it bestie, it's giving extensive. πŸ“šβœ¨


πŸ’œ AUTHOR πŸ’œ

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


and that's the whole thing!! πŸŽ‰ this was PUMA 3.12, from January 2020 β€” yes she's a lil vintage but she ate and left no crumbs. mwah, go run your server bestie πŸ’…πŸ¦‹πŸŒΈ