Self-Host Instructions
Self-host Engine on your own infrastructure for free and manage your self-hosted Engine from the thirdweb dashboard.
Requirements
- Docker
- A thirdweb secret key from the API Keys page
Development
Bring your own Postgres-compatible database, or run Postgres locally:
Run Engine locally:
Note: Replace POSTGRES_CONNECTION_URL
with your database URL.
Environment variables
Your server is running when this log line appears:
Manage Engine from the dashboard
To manage your Engine instance from the dashboard:
-
Navigate to
https://localhost:3005/json
- The "Your connection is not private" page will appear.
- Select Show advanced and select Proceed to localhost (unsafe) to render the JSON file.
- This one-time step allows your browser to connect to your local Engine instance.
-
Navigate to the Engine dashboard page.
-
Sign in with the
<admin_wallet_address>
wallet. -
Select Import
-
Add your publicly accessible Engine URL.
- If Engine is running locally, provide the URL
https://localhost:3005
.
- If Engine is running locally, provide the URL
Production
See the Production Checklist for best practices using Engine in a production environment.
Self-hosting recommendations
- Do not set the environment variable
ENABLE_HTTPS=true
. - Host Engine Docker on a cloud provider.
- Minimum specs: 1 vCPU, 2 GB memory (AWS equivalent: t2.small)
- Auto-scale the instance count to increase inbound throughput and queuing capacity.
- Host Postgres DB on a cloud provider.
- Examples: AWS RDS, Google Cloud SQL, Heroku, Supabase
- Minimum specs: 2 vCPU, 2 GB memory (AWS equivalent: t4g.small)
- Set the
connection_limit
parameter within yourPOSTGRES_CONNECTION_URL
environment variable to10
.
FAQ
How do I filter logs in Engine?
Configure log verbosity via the LOG_LEVEL
environment variable.
The severity levels ordered from highest to lowest are:
fatal
: Terminates the program due to critical errors.error
: Highlights serious issues needing immediate action.warn
: Suggests caution due to potential issues.info
: Shares routine operational insights.debug
: Provides detailed debugging information.trace
: Offers in-depth tracing details.
Engine by default captures logs at debug
severity and higher. Setting LOG_LEVEL
to error
limits logging to only error
and fatal
severities.
How to prevent SIGSEGV
errors with the Engine docker image?
Ensure the Engine docker image's stability by allocating a minimum of 0.5 vCPU & 1 GB memory
to the container, mitigating SIGSEGV
(Segmentation Fault) errors due to inadequate resources or memory access issues.
Engine recommends a minimum DB connections limit of 8
PER HOST. Please set the connection_limit
parameter within your POSTGRES_CONNECTION_URL
environment variable, to allow a connection limit between (8, # conns supported by your DB / # hosts). In practice, 10-20 is a suitable connection limit.
DB Error:
Example configuration: