Skip to content

Environment (.env) ​

The .env file in the project root holds the platform's server-level configuration: addresses, passwords, service keys and on/off switches. Most business settings live in the admin panel instead. This page explains each group and the values a live exchange needs.

15 minutesServer administrationDevOpsVerified against the platform code

Every variable, with its default

This page explains the groups. The full list, with defaults and the file that reads each one, is in the Environment variables reference.

How changes take effect ​

After changingDo this
Most valuesphp artisan config:clear. Then php artisan horizon:terminate, because background workers keep the values they started with.
MIX_* valuesRebuild both front-end bundles (Building assets). These are copied into the JavaScript at build time.
Values used by bridges or the chart serviceRestart that process: pm2w restart bridge-ethereum, pm2w restart chart
PUSHER_* valuesAll three: clear config, restart Horizon, and rebuild (the MIX_PUSHER_* lines copy them)

Some admin settings write to .env

The site name, email, captcha (Turnstile) and Unlimit settings in the admin panel are saved into this file. So .env must be writable by the web server user, and anything you edit by hand in those lines can be overwritten from the admin panel. See Settings stored in the .env file.

Production values that matter most ​

ini
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com
SANCTUM_STATEFUL_DOMAINS=yourdomain.com

CACHE_DRIVER=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis
BROADCAST_DRIVER=pusher
REDIS_CLIENT=phpredis

READ_ONLY_MODE=false
USER_ASSETS="false"

Common mistakes ​

MistakeWhat happens
SESSION_DRIVER=array or CACHE_DRIVER=array (the example values)Nobody stays signed in. Live statistics aren't kept.
QUEUE_CONNECTION=syncEvery job runs inside the web request. Pages become slow and order processing blocks.
BROADCAST_DRIVER=logLive updates are written to the log instead of being sent. Prices look frozen.
APP_DEBUG=trueError pages show configuration values, including passwords, to anyone
APP_ENV other than production / localHorizon starts no workers (Queues)
SANCTUM_STATEFUL_DOMAINS not set to your domainThe site's own requests to its API are rejected. Signed-in pages fail to load data.
USER_ASSETS="true" left after a buildThe admin panel returns 404
Changing APP_KEY on a running siteEveryone is signed out and two-factor authentication stops working

The groups ​

Application ​

APP_NAME (shown in emails, the chart and the browser title), APP_ENV, APP_KEY (generated once with php artisan key:generate), APP_DEBUG, APP_URL (with https://), SANCTUM_STATEFUL_DOMAINS (your domain without https://), LOG_CHANNEL, and APP_PLAN (keep 5 for the full package with futures, P2P and options processors).

Database ​

DB_CONNECTION=pgsql with DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD. The bridges read the same values to connect to the database. The PG* lines below them only copy these values for PostgreSQL command-line tools such as psql and pg_dump.

Cache, sessions, queues and Redis ​

CACHE_DRIVER, SESSION_DRIVER and QUEUE_CONNECTION (all redis in production), and REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_CLIENT (phpredis if the PHP redis extension is installed, otherwise predis).

Email ​

MAIL_MAILER, MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, MAIL_ENCRYPTION, MAIL_FROM_ADDRESS, MAIL_FROM_NAME, and MAILGUN_DOMAIN, MAILGUN_SECRET, MAILGUN_ENDPOINT for the Mailgun API. Usually set from Admin → Settings → Email.

Real-time (WebSockets) ​

BROADCAST_DRIVER=pusher, PUSHER_APP_ID, PUSHER_APP_KEY, PUSHER_APP_SECRET, PUSHER_HOST, PUSHER_PORT, PUSHER_SCHEME, PUSHER_APP_CLUSTER, and their MIX_PUSHER_* copies for the browser. Must match socket-config.json. See Real-time.

Front-end build ​

USER_ASSETS (which route set the server loads, "false" when running) and USER_ASSETS_HASH (cache-busting value, changed after every build). See Building assets.

Charts ​

TRADINGVIEW_CHART_PORT (8081), TRADINGVIEW_CHART_SSL (keep the line, normally "false"), and TRADINGVIEW_CHART_PRIVATE_KEY / TRADINGVIEW_CHART_CERT_FILE for built-in HTTPS. See Chart service.

Background processes ​

PM_PATH (PM2 home, /var/www), PM_PHP_PATH, PM_USR_PATH, PM_SERVICE_WATCHER_ENABLED and PM_MARKET_WATCHER_ENABLED. See Installation → Prepare PM2.

Blockchains ​

NetworkVariables
EthereumAPP_ETHEREUM_NODE (required), APP_ETHERSCAN_KEY
BNB Smart ChainAPP_BNB_NODE, APP_BSCSCAN_KEY
PolygonAPP_POLYGON_NODE, APP_POLYGONSCAN_KEY
TronAPP_TRONGRID_API
SolanaSOLANA_RPC_ENDPOINT
TONTON_RPC_ENDPOINT, TON_API_KEY, APP_TON_PORT
XRP LedgerXRP_RPC_ENDPOINT
BitcoinBITCOIND_HOST, BITCOIND_PORT, BITCOIND_USER, BITCOIND_PASSWORD

See Blockchain bridges.

Liquidity and prices ​

BINANCE_API_KEY / BINANCE_API_SECRET for the liquidity provider connection, and CURRENCYAPI_KEY for daily fiat exchange rates.

Sign-in with other accounts ​

ProviderVariablesButton shown when
GoogleGOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REDIRECT_URI (https://yourdomain.com/login/google/callback)Always. Fill in the keys, or users get an error when they click it.
Phone (SMS codes, Twilio)SMS_DRIVER=twilio, TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_VERIFY_SID (recommended) and/or TWILIO_FROMAlways offered; shows "SMS is not available" until Twilio is set. See Phone registration
TelegramTELEGRAM_BOT_TOKEN, TELEGRAM_BOT_USERNAME (bot from @BotFather; set its domain with /setdomain)TELEGRAM_BOT_TOKEN is set and TELEGRAM_AUTH_ENABLED isn't false
AppleAPPLE_CLIENT_ID, APPLE_CLIENT_SECRET, APPLE_KEY_ID, APPLE_TEAM_ID, APPLE_PRIVATE_KEY, APPLE_PASSPHRASE, APPLE_REDIRECT_URI (https://yourdomain.com/auth/apple/callback)APPLE_AUTH_ENABLED=true

Step-by-step setup for each: Google, Apple, Telegram, Passkeys, SMS with Twilio.

Register the callback addresses exactly as shown with each provider. See Sign-up & social login.

KYC, payments and custody ​

ServiceVariables
SumsubSUMSUB_ENABLED, SUMSUB_APP_TOKEN, SUMSUB_APP_SECRET, SUMSUB_WEBHOOK_SECRET, SUMSUB_KYC_LEVEL
Unlimit (GateFi) card on-rampUNLIMIT_ENABLED, UNLIMIT_ACCESS_KEY, UNLIMIT_SECRET_KEY, UNLIMIT_PARTNER_ACCOUNT_ID, UNLIMIT_BASE_URL
PayeerPAYEER_MERCHANT_ID, PAYEER_MERCHANT_KEY, PAYEER_ACCOUNT_ID, PAYEER_API_KEY, PAYEER_API_ID
Perfect MoneyPERFECT_MONEY_LOGIN, PERFECT_MONEY_PASSWORD, PERFECT_MONEY_ACCOUNT_ID
FireblocksFIREBLOCKS_ENABLED, FIREBLOCKS_API_KEY, FIREBLOCKS_BASE_URL, FIREBLOCKS_PUBLIC_KEY_PATH
Captcha (Cloudflare Turnstile)TURNSTILE_SITE_KEY, TURNSTILE_SECRET_KEY (usually set in Admin → Settings → Captcha)
File storage on S3AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION, AWS_BUCKET (not used unless you change the storage disk)

Feature flags ​

FlagDefaultWhen true
READ_ONLY_MODEfalseDemo mode. Every change (anything other than viewing a page) is refused with "In Demo Version we enabled READ ONLY mode…". New users get demo balances, any signed-in user can give themselves the staff roles (not superadmin) at /demo-mode, the login form is filled in with the demo account (DEMO_LOGIN_EMAIL / DEMO_LOGIN_PASSWORD), and the scheduler runs only the process watchers and mini-charts. Never on a live exchange.
DEMO_LOGIN_EMAIL, DEMO_LOGIN_PASSWORD[email protected], 123123123Only with READ_ONLY_MODE=true: the login form opens with these filled in. The account is not created for you; create it yourself. Never sent to browsers when read-only mode is off.
UI_PALETTEgoldBrand colour palette for the website: gold, ember, ocean, violet, mint (themes)
UI_PALETTE_PICKERfalsetrue shows the Color theme choice to visitors
LENDING_ENABLEDfalseTurns on Lending: its site pages and admin section
MERCHANT_ACQUIRING_ENABLEDfalseTurns on Merchant payments
MATCHING_ENGINE_ENABLEDfalseUses the Rust matching engine for markets without a liquidity provider
UNLIMIT_ENABLEDfalseShows the Buy crypto pop-up
SUMSUB_ENABLEDfalseUses Sumsub for identity verification instead of the built-in review
FIREBLOCKS_ENABLEDfalseUses Fireblocks for supported deposit wallets
ENABLE_AUTO_WITHDRAWALSfalseEvery 2 minutes, approves up to 5 waiting withdrawals whose amount the hot wallet can cover, without an admin
DEPOSIT_BONUS_ENABLEDfalseAwards deposit bonuses
FIXED_SWAPfalseSwaps run at the market's last price, even when the order book is empty (needs a last price)
ENABLE_FEES_IN_USDfalseShows fixed withdrawal fees to users as USD amounts, converted at the coin's current price
HIDE_CMC_GECKOtrueHides internal and gateway endpoints from the public API reference
SENSITIVE_MODEfalseMasks secret keys and passwords in the admin settings with **** (useful for demos and screen sharing)
APPLE_AUTH_ENABLEDfalseShows sign-in with Apple
TELEGRAM_AUTH_ENABLEDtrueShows sign-in with Telegram (needs TELEGRAM_BOT_TOKEN)
DEBUGBAR_ENABLEDfalseDeveloper debug bar. Never on a live site.

Values in .env.example you can ignore ​

TRADE_FREQUENCY and MIX_SOCKET_PORT aren't read by the current code. MEMCACHED_HOST only matters if you switch the cache to Memcached.

Owner documentation for the CryptoTech exchange platform.