Skip to main content

Build from Source (Advanced)

warning

This method is not recommended for most users. It is intended for advanced users who are familiar with managing their own server infrastructure.

Refer to Configuring Databases for details on how to configure your database.

Prerequisites

Unix (Linux, macOS)

Installation

  1. Assuming you want the working directory to be /opt/foreseerr, create the directory and navigate to it:
sudo mkdir -p /opt/foreseerr && cd /opt/foreseerr
  1. Clone the Foreseerr repository. Use a release tag for production, or develop for the latest unreleased work:
git clone https://github.com/selmant/foreseerr.git .
git checkout v0.8.1
  1. Install the dependencies:
CYPRESS_INSTALL_BINARY=0 bun install --frozen-lockfile
  1. Build the project:
bun run build
  1. Start Foreseerr:
bun run start
info

You can now access Foreseerr by visiting http://localhost:5055 in your web browser.

Extending the installation

To run Foreseerr as a systemd service:

  1. create the environment file at /etc/foreseerr/foreseerr.conf:
## Foreseerr's default port is 5055, if you want to use both, change this.
## specify on which port to listen
PORT=5055

## specify on which interface to listen, by default Foreseerr listens on all interfaces
#HOST=127.0.0.1

## Uncomment if you want to force Node.js to resolve IPv4 before IPv6 (advanced users only)
# FORCE_IPV4_FIRST=true
  1. Then run the following commands:
which bun

Copy the path to bun, it should be something like /usr/bin/bun.

  1. Create the systemd service file at /etc/systemd/system/foreseerr.service, using either sudo systemctl edit --force --full foreseerr or sudo nano /etc/systemd/system/foreseerr.service:
[Unit]
Description=Foreseerr Service
Wants=network-online.target
After=network-online.target

[Service]
EnvironmentFile=/etc/foreseerr/foreseerr.conf
Environment=NODE_ENV=production
Type=exec
Restart=on-failure
WorkingDirectory=/opt/foreseerr
ExecStart=/usr/bin/bun dist/launcher.js

[Install]
WantedBy=multi-user.target
note

If you are using a different path to bun, replace /usr/bin/bun with the path to bun.

  1. Enable and start the service:
sudo systemctl enable foreseerr
sudo systemctl start foreseerr

Windows

Installation

  1. Assuming you want the working directory to be C:\foreseerr, create the directory and navigate to it:
mkdir C:\foreseerr
cd C:\foreseerr
  1. Clone the Foreseerr repository. Use a release tag for production, or develop for the latest unreleased work:
git clone https://github.com/selmant/foreseerr.git .
git checkout v0.8.1
  1. Install the dependencies:
$env:CYPRESS_INSTALL_BINARY = 0; bun install --frozen-lockfile
  1. Build the project:
bun run build
  1. Start Foreseerr:
bun run start
tip

You can add the environment variables to a .env file in the Foreseerr directory.

info

You can now access Foreseerr by visiting http://localhost:5055 in your web browser.

Extending the installation

To run Foreseerr as a bat script:

  1. Create a file named start-foreseerr.bat in the Foreseerr directory:
@echo off
set PORT=5055
set NODE_ENV=production
bun dist/launcher.js
  1. Create a task in Task Scheduler:
  • Open Task Scheduler
  • Click on "Create Basic Task"
  • Name the task "Foreseerr"
  • Set the trigger to "When the computer starts"
  • Set the action to "Start a program"
  • Set the program/script to the path of the start-foreseerr.bat file
  • Set the "Start in" to the Foreseerr directory.
  • Click "Finish"

Now, Foreseerr will start when the computer boots up in the background.

Updating

To update Foreseerr, navigate to the Foreseerr directory, fetch the tag or branch you want, then rebuild and restart:

git fetch --tags
git checkout v0.8.1
bun install --frozen-lockfile
bun run build

Then restart the process or service you configured above.