Skip to content

Run a refgenie server

Refgenie includes a built-in server that exposes a REST API for listing, browsing, and downloading genome assets. The server also provides GA4GH DRS endpoints and can aggregate data channels from multiple sources.

Terminal window
refgenie serve

This starts the server on port 8000 by default.

FlagDescription
-p, --portPort to run the server on (default: 8000)
-r, --reloadEnable auto-reload on code changes (for development)

Example with custom port:

Terminal window
refgenie serve -p 5000

The server reads the same environment variables as the CLI:

VariableDefaultDescription
REFGENIE_HOME_PATH~/.refgenieBase directory for refgenie files
REFGENIE_DB_CONFIG_PATH$REFGENIE_HOME_PATH/refgenie_db_config.yamlPath to database config
REFGENIE_GENOME_FOLDER$REFGENIE_HOME_PATH/genomesDirectory for genome asset data
REFGENIE_GENOME_STAGE_FOLDER$REFGENIE_HOME_PATH/archivesDirectory for staged assets (served to clients)
REFGENIE_LOG_LEVELINFOLog verbosity

For production deployments, configure PostgreSQL as the database backend. See Database backends for setup details.

The server serves assets from the stage folder (REFGENIE_GENOME_STAGE_FOLDER). Before assets are available to clients, they must be built and staged:

Terminal window
# 1. Build the asset
refgenie build hg38/fasta
# 2. Stage the asset (creates symlinks or tarballs in the stage folder)
refgenie stage stage hg38/fasta
# 3. Start the server
refgenie serve

You can combine building and staging in one step:

Terminal window
refgenie build hg38/fasta --stage

See Stage assets for serving for details on the staging system.

Once the server is running, you can:

  • Browse the API docs at http://localhost:8000/docs (Swagger UI)
  • List available assets via the REST API
  • Use refgenie pull from any client machine pointed at your server

On a client machine, subscribe to a remote server:

Terminal window
refgenie subscribe -s http://your-server:8000

Then pull assets:

Terminal window
refgenie pull hg38/fasta
Featurerefgenie serverefgenie dash
PurposeServe assets to remote clients via APIBrowse your local refgenie instance
NetworkExposes HTTP API for external clientsLocal web UI only
Default port80008080

See Use the dashboard for dashboard documentation.