Running phoenix server in background

Hello all,
How can I run a phoenix server in background of my droplet ( or just say the os).
I am looking for some process manager like pm2 is there for nodejs.
Thanks.

The best-practice way of doing this is definitely to generate an Erlang release using something like https://github.com/bitwalker/distillery. A release will package everything up into a nice tarball so that you don’t have to have Mix and all that installed on your droplet. Then, running your release in the background is easy! Once you have the release unpacked, just run bin/<name> start to run your app in the background as a daemon! To stop it just do bin/<name> stop.

You can check out the walkthrough here: https://hexdocs.pm/distillery/walkthrough.html.

2 Likes
  • run mix phx.server in tmux :stuck_out_tongue:
  • run mix phx.server with systemd
  • build release and run it with systemd
  • build docker image and run it with systemd
  • build docker image and run it k8s

Also build docker image and run it with Docker Compose :slight_smile: