Skip to main content

Set Up on Linux

Follow these steps to configure your environment variablesThe BuildNinja Server and Agent rely on environment variables to define their configuration and communication parameters. These variables determine how the server manages builds, connects to the database, and handles aut… on a Linux system.

  1. Open a terminal window.

  2. Edit your shell configuration file (for example, .bashrc or .zshrc, depending on your shell).

    nano ~/.bashrc
  3. Add the environment variables to the end of the file.

    # Server
    export BN_SERVER_PUBLIC_URL="http://localhost:8800"
    export BN_SERVER_PORT=8800
    export BN_SERVER_MONGOURI="mongodb://user:pass@localhost:27017/xxcicd_db?authSource=admin"
    export BN_SERVER_MONGODB=bn_server_stage
    export BN_SERVER_DATA_DIR="/var/lib/buildninja/data"
    export BN_SERVER_JWT_SIGN_KEY="s3cure$ecretKey_123!xyz"
    export BN_SERVER_SSL_CERT="/etc/ssl/certs/buildninja.crt"
    export BN_SERVER_SSL_KEY="/etc/ssl/private/buildninja.key"

    # Agent
    export BN_AGENT_NAME="agent-linux-01"
    export BN_AGENT_PORT=9500
    export BN_AGENT_SERVER_URL="http://192.168.1.100:8800"
    export BN_AGENT_SELFURL="http://192.168.1.52:9500"
    export BN_AGENT_DATA_DIR="/var/lib/buildninja/agent/data"
  4. Save and exit the file. Press Ctrl + X, then Y, and press Enter to confirm.

  5. Apply the changes to your current shell session.

    source ~/.bashrc