pentacent / keila

Open Source Newsletter Tool.
https://keila.io
GNU Affero General Public License v3.0
1.45k stars 81 forks source link

Self-hosting - Bare metal install instructions #329

Closed CodeShakingSheep closed 3 months ago

CodeShakingSheep commented 3 months ago

Hi, first of all thanks for this project. It looks promising and I'm curious to try it out. What's keeping me from installing it is that I strictly don't use Docker on my server. So, my question is, is it possible to do a bare metal installation? If yes, how? Would be awesome to have instructions about that added to the docs. Thank you 🙏

wmnnd commented 3 months ago

You can follow the build steps in the Dockerfile and run Keila like that, it’s pretty straightforward :-)

wmnnd commented 3 months ago

You just need Elixir installed, then follow the steps here, skipping the Docker-specific parts like using two separate images for building and executing: https://github.com/pentacent/keila/blob/main/ops/Dockerfile

CodeShakingSheep commented 3 months ago

Hm ok. So, just to be clear, I would do the following:

Did I miss anything? Also, in docker-compose.yaml there are some ENV vars defined, such as DB_URL etc. Where do I specify these in a bare metal installation? Thank you.

wmnnd commented 3 months ago

You don’t necessarily have to add the user, that’s just a Docker best practice. Though I would not recommend running Keila as root on your server. It’s also not necessary to expose port 4000, you probably want to use a reverse proxy like nginx to terminate HTTPS and expose Keila on port 443.

The configuration environment variables have to be defined in such a way that the app can see them when it boots up.

CodeShakingSheep commented 3 months ago

Always adding a dedicated app user. Yes, you're right, that's what I meant. I'm running nginx on my server for reverse proxying. As for the ENV vars, would it be possible to use a .env file in Keila's installation directory to read the vars from (that's how I know it from other self-hosted apps)? Because I'd prefer the ENV vars to be app-wide, not system-wide. How can this be achieved?

wmnnd commented 3 months ago

The env vars don't need to be system-wide, they just need to be present in the environment from which you launch Keila. This could be a custom launch script or a systemd service, etc.

CodeShakingSheep commented 3 months ago

Alright, thank you for the hints. Will go down the road with a systemd service. That should work. Will tinker with it on the weekend and report back.

wmnnd commented 3 months ago

Okay, keep us posted! I’ll close this issue as resolved but please feel free to comment an update here :blush: