Skip to content

jlf326/actual-server

 
 

Repository files navigation

This is the main project to run Actual, a local-first personal finance tool. It comes with the latest version of Actual, and a server to persist changes and make data available across all devices.

Join the discord!

Non-technical users

We are looking into a feature for one-button click click deployment of Actual. This will reduce the friction for people not as comfortable with the command line.

Running

It's very easy to get started. Clone this repo, install deps, and start it:

git clone https://github.com/actualbudget/actual-server.git
cd actual-server
yarn install
yarn start

Go to https://localhost:5006 in your browser and you'll see Actual.

Deploying

You should deploy your server so it's always running. We recommend fly.io which makes it incredibly easy and provides a free plan.

Create an account. Although you are required to enter payment details, everything we do here will work on the free tier and you won't be charged.

I got Actual deployed to fly.io here are the instructions I used - understandably these are for Windows but should work with a few tweaks for MacOSX & Linux.

  1. Press start, type cmd and run it as administrator

  2. Navigate to the C:\

cd C:\
  1. Create a folder called github.
mkdir github
  1. Open up a command prompt and run
iwr https://fly.io/install.ps1 -useb | iex
  1. Once that is complete run this command
flyctl auth login

This should open a web browser and ask you to login - you will need to provide credit card details to proceed but actual shouldn't cost much if anything at all.

  1. Now we need to move into the github directory we just created on the C:\ drive, to do that we can use this command
CD C:\github

Note: CD means change directory

  1. Now run this command
git clone `https://github.com/actualbudget/actual-server.git`

This will pull down the latest files for actual-server from the git hub repository to our local machine.

  1. Then we need to move into that folder, to do that use this command
cd actual-server
  1. Let's check to make sure we are in the correct place
dir

You should see a list of files in a list one of them being fly.template.toml if you don't see them go back to step 6

  1. Copy fly.template.toml that is in the folder called actual-server within C:\GitHub and copy it back into the same directory with the name fly.toml
copy fly.template.toml fly.toml
  1. Open the fly.toml file in notepad or a code editor of your choice like Visual Studio Code
notepad fly.toml
  1. On line 1 change app = "%NAME%" to something of your choosing like app = "Actual" and save the file

  2. Still on the command prompt run

flyctl launch

You will see a message that says An existing fly.toml file was found for app Actual Budget ? Would you like to copy its configuration to the new app? (y/N)

  1. Type Y and hit enter

It asked me to give my application a name, I just left it blank and it picked one for me. I did this becuase no matter what I typed it errored.

  1. Select your location using the up down arrow keys when prompted

  2. Would you like to setup a Postgresql database now? (y/N)

Type N and press enter

  1. The application should begin deploying.

Once complete you should now be able to navigate to actual using the URL provided. To find that open https://fly.io/dashboard in a browser and click the application, it might have a really random name

One you are in there, you should see hostname section right at the tope and under that is a URL this is the URL to your deployment of actual..

Whenever you want to update Actual, update the versions of @actual-app/api and @actual-app/web in package.json and run flyctl deploy.

Note: if you don't want to use fly, we still provide a Dockerfile to build the app so it should work anywhere that can compile a docker image.

Persisting server data

One problem with the above setup is every time you deploy, it will wipe away all the data on the server. You'll need to bootstrap the instance again and upload your files.

Let's move the data somewhere that persists. With fly.io we can create a volume. Run this command:

flyctl volumes create actual_data

Now we need to tell Actual to use this volume. Add this in fly.toml:

[mounts]
  source="actual_data"
  destination="/data"

That's it! Actual will automatically check if the /data directory exists and use it automatically.

You can also configure the data dir with the ACTUAL_USER_FILES environment variable.

Configuring the server URL

The Actual app is totally separate from the server. In this project, they happen to both be served by the same server, but the app doesn't know where the server lives.

The server could live on a completely different domain. You might setup Actual so that the app and server are running in completely separate places.

Since Actual doesn't know what server to use, the first thing it does is asks you for the server URL. If you are running this project, simply click "Use this domain" and it will automatically fill it in with the current domain. This works because we are serving the app and server in the same place.

About

Actual Budget Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.7%
  • Dockerfile 1.3%