⭐ If you find Zipline useful, please consider giving it a star on Github! ⭐

Building from source

Build and run Zipline from source. Not recommended for most users.

Build from source if you need to customize Zipline or manage its dependencies yourself. For most installations, use Docker. To work on Zipline, follow the development setup.

Install Prerequisites

You'll also need a PostgreSQL server or a local PGlite directory.

Clone the repository

Choose a stable version from Zipline's releases. The examples use v4.8.2; replace it with the release tag you want to install.

git clone https://github.com/diced/zipline
cd zipline
git switch --detach v4.8.2

Building Zipline

Before building Zipline, create a .env file and configure a database. You can use a running PostgreSQL server, as below, or a local PGlite directory.

# Replace username and password with your PostgreSQL credentials
DATABASE_URL=postgresql://username:password@localhost:5432/zipline

# These two are optional, but you can set them to change the hostname and port
CORE_HOSTNAME=0.0.0.0
CORE_PORT=3000

You will also want to setup a datasource for your instance. By default, Zipline will use ./uploads for local file storage. You can configure a different datasource (e.g. S3) by setting the appropriate environment variables in the .env file.

You will also need to generate a secret for zipline, to do this you can use the command below to append it to your .env file:

echo "CORE_SECRET=$(openssl rand -base64 42 | tr -dc A-Za-z0-9 | cut -c -32 | tr -d '\n')" >> .env

What does this command do?

openssl rand -base64 42 | tr -dc A-Za-z0-9 | cut -c -32 | tr -d '\n'
  • openssl rand -base64 42: Generate 42 random bytes in base64 encoding.
  • tr -dc A-Za-z0-9: Remove all characters except for letters and numbers.
  • cut -c -32: Cut the string to 32 characters.
  • tr -d '\n': Remove the newline character.

Then build Zipline:

pnpm build

Run the server

pnpm start

Updating

Before updating, read the 4.8 upgrade notes.

Stop the running Zipline server. Fetch the release tags and select the version you want to install, replacing v4.8.2 below:

git fetch --tags origin
git switch --detach v4.8.2

Then update dependencies and build Zipline:

pnpm install
pnpm build

Then start the server:

pnpm start

Next steps

After setting up Zipline, you may want to: