Deploy Server¶
TLDR
The Labtasker server can be deployed in two ways, depending on the database backend and the chosen deployment method.
Deployment Method | Server | Database |
---|---|---|
Python Native labtasker-server |
Local Environment | A Python Emulated Embedded DB |
docker compose | Run inside a container | MongoDB Service |
Method 1. Python Native (Easy)¶
This is the simplest way to get started with Labtasker using only Python dependencies. The embedded database makes setup fast and straightforward.
Then, to start a Labtasker server (with embedded database) in the background, run the following command:
Method 2. Docker Compose (Advanced)¶
This method is recommended for scenarios where you need more robust database capabilities and containerized deployment.
Prerequisites¶
- Docker Compose
Step 1: Configuration¶
-
Clone the repository:
-
Create your environment file:
-
Configure your settings in
server.env
:- Configure MongoDB.
- Configure server ports.
- Configure how often you want to check for task timeouts.
Step 2: Start services¶
-
Start services (first time or update existing services):
-
Check status:
-
View logs:
Database Management¶
To expose MongoDB for external tools (this is potentially risky):
- Set
EXPOSE_DB=true
inserver.env
- Optionally set
DB_PORT
to change the exposed port (default: 27017) - Use tools like MongoDB Compass to connect to the database.