Run Financy for your household on a server you rent or own, from a fresh server to everyone signed in. Self-hosting is free under the AGPL-3.0 licence; you pay only for the server.
A fresh install took 15 minutes on a Hetzner cx23 server (2 shared CPUs, 4 GB), from ordering the server to a signed-in household. The first deploy, which builds the images on the server, took 3 of them.
You need:
- An Ubuntu server you can reach over SSH as root, and a domain whose DNS you control.
- Your own computer with Deno, rsync and git. The deploy runs from there and builds the images on the server.
The examples use deploy@192.0.2.10 for the server and money.example.com for Financy's address.
Seed, the starter Financy is built on, explains every step in more depth in Deploy to a server (on GitHub). This guide is the short path for a household.
Follow Deploy to a server (on GitHub), "The server" and "The firewall": a deploy
user with uid 1000, SSH keys only, Docker with Compose, rsync, unzip and Deno, and only ports 22,
80 and 443 open. Two things that page does not say:
- Keep the root session open until the firewall is on. The second step of "The server" turns root
logins off, the
deployuser has nosudo, and installing Docker and turning on the firewall need root. - Install Deno with
curl -fsSL https://deno.land/install.sh | sh -s -- -y. Without-y, an installer that cannot ask leaves Deno off thePATH, anddeno taskin step 5 is not found.
Create an A record, and an AAAA record for IPv6, for money.example.com pointing at the
server. You need no other host: the household's app, its API and its files all answer there. Check
it before you go on:
dig +short money.example.com
On your computer, clone the repository and check out the newest release:
git clone https://github.com/spy4x/financy.git && cd financy
git tag --sort=-v:refname
git switch --detach v0.1.0
Use the first tag the second command prints in place of v0.1.0.
Copy the example. The copy stays on your computer; git ignores it:
cp infra/envs/.env.example infra/envs/.env.prodSet these values:
Variable Value ENVprodPROJECTfinancyDOMAINmoney.example.comADMIN_DOMAINEmpty, unless you want the admin panel. TRAEFIK_ACME_EMAILYour address, for certificate notices. SSH_TO_SERVERdeploy@192.0.2.10PATH_ON_SERVERfinancy, a folder in the deploy user's home.PROXY_HTTPS_HOST_PORT443PROXY_HTTP_HOST_PORT80COMPOSE_PROFILESfilesTIMEZONEYour IANA time zone, such as Europe/Berlin.SPA_CPU_LIMIT1. The example's4fails on 2 CPUs.SMTP_*All five: your mail provider's SMTP account. Give every secret a value of its own, as the secrets table in The env file (on GitHub) says. The deploy refuses a secret left as in the example, and names it.
Mail is required: Financy emails a code to everyone who signs up, signs in by emailed code or resets a password. Without the five
SMTP_*values that code never arrives, so nobody can make an account. The mail server must speak TLS: implicit TLS on port 465, or STARTTLS on any other port, with a certificate valid forSMTP_HOST.Keep a copy of
infra/envs/.env.prodin your password manager. It holds the only copy of the secrets and the key of the file store, and no backup saves it.
What a household leaves out:
- Billing. Leave
BILLING_PROVIDERempty. Billing is then off and every household on your server has every feature, with no limits. - The website. Leave
mpaout ofCOMPOSE_PROFILESandMPA_DOMAINempty. The website is financy.dev's marketing site; your household does not need it. - The admin panel is optional. To have it, add
admintoCOMPOSE_PROFILES, setADMIN_DOMAINto a second host with its own DNS record, and after the deploy make yourself its administrator as Give operators access (on GitHub) says. - Monitoring is optional too: add
monitoringtoCOMPOSE_PROFILESfor Grafana, metrics and logs on the server.
Exchange rates work with no setting: Exchange rates says where they come from and what a key adds.
Create Financy's folder on the server:
ssh deploy@192.0.2.10 mkdir -p financyDeploy from your computer, in the repository:
deno task deployStart the proxy that answers HTTPS, once per server:
ssh deploy@192.0.2.10 cd financy && deno task proxy:startCheck that Financy answers. It must print
"status":"ok"and200:curl -sS -w '\n%{http_code}\n' https://money.example.com/api/health
For up to a minute after a deploy it can answer 404 page not found, until the new API passes its
health check; try again. When it still does not, Check it (on GitHub) and
HTTPS certificates (on GitHub) say what to look at.
Anyone who reaches money.example.com can make an account until you close sign-up. So do this
right after the deploy:
Open
https://money.example.com, sign up, and create a group for your household.In the group's Members tab, choose Invite for each member, create the invitation and send them its link. They open it, sign up, enter the code from their mail and accept the invitation.
Once everyone has an account, close sign-up. Set this in
infra/envs/.env.prod, where the example has an emptySIGN_UP=, and deploy again:SIGN_UP=invitedeno task deploy
People with an account keep signing in as before.
For now, SIGN_UP=invite closes sign-up to everyone, an invitation included, because the sign-up
screens cannot carry one yet (seed#913). To add a
member later, empty SIGN_UP=, deploy, let them sign up from your invitation, then set it back
to invite and deploy again.
Your household's records live only on this server until you do: Backups.