WindowsmacOSLinux

Where Does Hledger Keep the Journal File?

Hledger reads a plain text journal file. The default location, the LEDGER_FILE override, and where to keep it.

Last updated

Hledger stores everything in one plain text journal. There is no database and no registry. You pick the file, hledger reads it, and reports come out the other side.

By default it looks for a file named .hledger.journal in your home folder, unless LEDGER_FILE or -f points elsewhere. That default keeps first runs working. Real setups name the file explicitly and keep it under version control with an include structure per year.

Where Hledger stores this, by platform

Windows
%USERPROFILE%\.hledger.journal

Default journal when LEDGER_FILE is unset. Override per command with hledger -f PATH, or permanently by setting LEDGER_FILE in the environment. The file is plain text and moves by copying.

macOS
~/.hledger.journal

Same default name under home. Most users outgrow it fast and keep a journal folder with yearly files plus an all.journal that includes them. Point LEDGER_FILE there once and forget the default.

Linux
~/.hledger.journal

Identical default to macOS. Scripts and cron jobs should export LEDGER_FILE explicitly rather than relying on home expansion, since service users often have a different home.

Frequently asked questions

How do I tell hledger which journal file to use?

Set the LEDGER_FILE environment variable to the journal path, or pass -f on the command line. The command line flag wins over the variable, and both win over the default file. Point all three at the same file and the confusion stops.

Can I keep my journal somewhere other than home?

Anywhere you like, then point LEDGER_FILE at it or pass -f each time. People commonly keep one journal per year beside the current one, with include lines pulling shared rules. Version control the folder and the history problem solves itself.

Notice an outdated path? Let us know.