How to auto deploy Phoenix on a vanilla Debian Linux server?

Here is what I want: A tool which I can trigger within a GitHub CI workflow to auto deploy a Phoenix server on a production system which runs a vanilla Debian Linux. I don’t want to solve it with Docker and I would kill for a hot deployment solution.

I can’t find an out of the box solution. Introduction to Deployment — Phoenix v1.7.12 doesn’t provide the final steps to clue everything together and I am too mediocre of an admin to fill the gaps myself.

I understand that most people use fly.io, Heroku or other similar solutions. Am I the only one who wants to use his own Debian system?

  • Is there a good out of the box tool that I haven’t found yet?
  • Is there a good step by step tutorial?
1 Like

You can build a release with GitHub Actions and the release archive will be your artefact. Then, again with Actions, you can copy it, using scp or rsync, to the server and [re]start the release. It’s plus if you run the release as a systemd service because it’ll be easier to manage it as just another program on the server.

I am aware how this could work. But I am looking for a fool proof step by step tutorial or a fool proof tool. Me reinventing the wheel will result in a lesser quality setup.

2 Likes

You can take a look at GitHub - cogini/mix_deploy: Library of mix tasks to deploy an Elixir release to servers (cloud instance or bare metal, automated deploy) and GitHub - cogini/mix_systemd: Library of mix tasks to generate a systemd unit file for an Elixir project.

3 Likes