spammy

spammy

I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on the wider internet).

Loosely, I’m looking for a simple self hosted “PaaS” solution.

I found this[1] thread very helpful, but it seems that most solutions are general purpose, heavier than I need and rely on a docker paradigm, either at the application development end, or the deployment end. Is docker an inevitably to embrace that would make this easy, or are there other solutions available?

potions.io seems to be the exception and appears to fit my needs, but there doesn’t seem to be a self-hosted version of it.

Or given my requirements should I just stick to the good ol’ server copy and service (ie systemd) management?

[1]Where do you host **small** or even tiny elixir projects?

Showing Posts 1 to 10

AndyL

AndyL

One option might be Xamal…

johantell

johantell

I’ve set up a server with coolify.io to run my personal projects. It’s essentially a PaaS that makes it easy to run multiple projects on the same server. Highly recommend if you don’t want to spend time documenting your setup (otherwise you will forget how you did it) and want to just run anything. It’s not elixir/phoenix-only but that’s not a downside in my opinion

LostKobrakai

LostKobrakai

I’ve followed Building a blog with Elixir and Phoenix in using dokploy. It’s essentially a UI for docker (+ docker swarm) + traefik, which is really nice. Even if the UI project might eventually go away the stack underneight is nothing special at all. I have it running on a hetzner VM for online stuff and on a VM in the basement for none shared stuff.

Only thing dokploy truely brings to the table is a system for building containers in various ways, from uploading plain zip files to pulling from repos and building in various ways, to pulling from docker registries.

rhcarvalho

rhcarvalho

Docker is not a hard requirement. I’ll try to make a parallel analogy: version control never was a hard requirement, and I’ve come across projects that didn’t use it. Yet, the moment you want to see how something was yesterday, even when you’re working alone, a version control system immediately becomes handy. Git “won the war” as the go-to solution.

You can track your Elixir dependencies in mix.exs, but the moment you rely on anything else on the system (e.g. particular Erlang or Elixir versions, system level dependencies, from ffmpeg to ca-certificates), then you’re going to want to keep track of that. Docker “won the war” in terms of packaging applications and their system level dependencies regardless of programming language stack.

There are other options like Ansible that can help you provision and maintain hosts, but Docker makes it really convenient to package and run multiple apps in a single host without conflicts.

People mentioned many tools in this personal-PaaS space, I’ll mention one more that is not particularly “sexy” but has worked for many years and is somehow a stable bet among modern contenders: https://dokku.com (limitation: single host).

spammy

spammy OP

Thank you all for the replies. I should have included my analysis from the referenced thread - here it is below, along with the couple of new suggestions:

So clearly if I relax the “no docker” requirement then there are lots of options available.

@rhcarvalho great post, and makes sense, thanks. I have less experience with Elixir deployments, so my naive hope is that all these private apps will be “rolling” to latest versions - I’d rather keep things as consistent and simple as possible and Docker comes with a load even if it’s totally used transparently.

This all might be wishful thinking though and is certainly hypothetical. So far then the plan will be to try xamal on a dedicated (LXC if possible) host, and then grow to a Docker backed solution once your prophecies come true! I have to admit it might be handy to have a platform that could run any language even if I have no intention of doing so.

LostKobrakai

LostKobrakai

I’d argue there’s always some tool around elixir to manage it from the outside, be it systemd, supervisord, docker, firecracker, …. That tool is one you want to understand. Docker just happens to bring a lot of further benefits in isolating the runtime elixir is started in.

(OCI) containers are also kind of a standard interface of doing things nowadays. Like dokploy can build using Nixpacks, Railpack, Buildpack (Heroku style) and plain compose and dockerfiles, but all become docker containers to run. Fly.io uses docker containers as the shippable artefact even though they convert it to firecracker vms before running them.

And most importantly to me is that it’s never just elixir I need to deploy. There might need to be a postgres for a database, prometheus for metrics, uptime kuma for uptime tracking, ….

In the end to me a docker based system is quite a bit simpler because it’s much closer to standards used/discussed in so many places over a system like kamal/xamal, where I need to learn that one specific tools inner workings – which is knowledge, which transfers much less to elsewhere.

rhcarvalho

rhcarvalho

To do that in lock-step is highly impractical. Like versioning files like report.docx, report final.docx, report final final v2.docx :slight_smile:

Since Mix Releases bake in the Erlang/Elixir runtime, you can get away with multiple versions of the runtime in the host, no problem. You won’t be able, though, to say what else you expect on the OS at runtime (true for any stack, requires either manual documentation or some form of automated provisioning, where Ansible, Dockerfile, etc come in).

:+1:


Since you are thinking about “microapps” and keeping everything consistent, maybe you should consider having everything be a single monolithic Phoenix app, providing all the disparate features you want. That means a single repo to maintain/work on, a single code base to deploy, and then you could even use good old sftp (or git) to transfer your files to the host and start a production server. Or use a small systemd service to make sure it keeps running if it ever crashes.

spammy

spammy OP

One thing that resonated on poitions.io (and I’ll reiterate that I’m no Elixir pro yet!) was the following:

PaaS Breaks the BEAM
You chose Elixir for fault tolerance, lightweight processes, and distributed state. PaaS platforms isolate containers and kill distributed Erlang. Don’t deploy it somewhere that holds you back.

Is this as much of a drawback as it sounds? Or does it practically not matter?

This is interesting, although I’d have to think of how to split out the code (presumably things could be made to build “plugged in” modularly).

LostKobrakai

LostKobrakai

Heroku as the fiest popular PaaS used to have no means of networking their apps or app instances together. This is an implementation issue, not one inherently present in all PaaS options. E.g. dokploy with docker swarm underneigh can do multi server deployments of many instances as far as I understand.

lpil

lpil

Creator of Gleam

I really like using Podman’s systemd integration for small deployments. It’s a lot less opinionated than most self hosted PaaS things, and it integrates very cleanly into a regular systemd setup, making it conceptually simpler.

I don’t have Elixir specific material, but I do have a guide for Gleam that could be converted to Elixir quite easily: Deploying Gleam on a Linux server | Gleam Programming Language

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews