Build from Source Code

This document guides you to build Bytebase from source code.

Prerequisite

  1. Install pnpm, Bytebase requires Node.js >=17.0.
  2. Install Go, Bytebaes requires Go >= 1.16

Environment Setup

It's recommended to run Bytebase application as non-root user for security reason. If you don't have other non-root users on the system, you can follow the following steps to setup one, e.g. user bytebase.

groupadd bytebase && useradd -g bb bytebase
sudo su bytebase

Build

Download source code from GitHub, then go to the source root directory

!

If you want to build from a specific release x.y.z, then switch to that tag.

git checkout tags/x.y.z

Build the source

scripts/build_bytebase.sh [<<out_directory>>]

If out_directoryis not specified, the default directory is ./bytebase-build

Suppose you run scripts/build_bytebase.sh foo After build completes, run:

foo/bytebase --port 8080

(check Server Startup Options for other startup options)

You should see something like this in the console:

██████╗ ██╗   ██╗████████╗███████╗██████╗  █████╗ ███████╗███████╗
██╔══██╗╚██╗ ██╔╝╚══██╔══╝██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝
██████╔╝ ╚████╔╝    ██║   █████╗  ██████╔╝███████║███████╗█████╗
██╔══██╗  ╚██╔╝     ██║   ██╔══╝  ██╔══██╗██╔══██║╚════██║██╔══╝
██████╔╝   ██║      ██║   ███████╗██████╔╝██║  ██║███████║███████╗
╚═════╝    ╚═╝      ╚═╝   ╚══════╝╚═════╝ ╚═╝  ╚═╝╚══════╝╚══════╝

Version 1.9.0 has started on port 8080

************* External Visiting URL (--external-url) *************

https://bytebase.example.com

******************************************************************

Troubleshoot

error: too many open files

Change the open file limit:

ulimit -n 10240