Deploying eLabFTW
Introduction
eLabFTW is a free, open-source electronic lab notebook (ELN) designed for research laboratories and scientific institutions. It provides a secure, organized platform for documenting experiments, managing protocols, and maintaining research data integrity. Used by thousands of research groups worldwide, eLabFTW helps scientists maintain good laboratory practices while transitioning from paper notebooks to digital documentation.
Built with PHP and MySQL, eLabFTW offers a modern web interface that researchers can access from any device. The application emphasizes data security and compliance, featuring timestamping, audit trails, and data export capabilities that meet the requirements of regulatory environments and good laboratory practice (GLP) standards.
Key highlights of eLabFTW:
- Electronic Lab Notebook: Document experiments with rich text, images, and file attachments
- Protocol Database: Create and share reusable experimental protocols
- Team Collaboration: Share experiments within teams while maintaining access control
- Timestamping: Cryptographic timestamps prove data integrity and creation dates
- Scheduling: Built-in scheduler for equipment booking and resource management
- API Access: REST API for integration with other laboratory systems
- Data Export: Export data in various formats including PDF, ZIP, and ELN standard format
- Compliance Ready: Audit trails and data integrity features for regulatory compliance
- Multi-language: Available in 20+ languages
- 100% Open Source: AGPL-3.0 licensed with active development
This guide walks through deploying eLabFTW on Klutch.sh, configuring your lab’s electronic notebook, and managing research documentation.
Why Deploy eLabFTW on Klutch.sh
Deploying eLabFTW on Klutch.sh provides several advantages for research laboratories:
Simplified Deployment: Klutch.sh handles infrastructure management, letting you focus on research documentation.
Data Ownership: Keep your research data on infrastructure you control rather than third-party services.
Persistent Storage: Attach volumes for your database and uploaded files that persist securely.
HTTPS by Default: Automatic SSL certificates ensure secure access to sensitive research data.
Scalable Resources: Allocate CPU and memory based on your laboratory size and usage patterns.
Always-On Availability: Your lab notebook remains accessible 24/7 for researchers in different time zones.
Prerequisites
Before deploying eLabFTW on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Basic familiarity with PHP applications and MySQL
- SMTP server access for email notifications
- A plan for organizing your laboratory teams and experiments
- (Optional) A custom domain for your institution
Understanding eLabFTW Architecture
eLabFTW uses a traditional LAMP-stack architecture:
PHP Application: The core application handles user authentication, experiment management, and web interface.
MySQL Database: Stores experiments, user data, team structures, and metadata.
File Storage: Uploaded files (images, documents, raw data) are stored on the filesystem.
Redis Cache: Optional caching layer for improved performance.
Timestamping Service: Integration with RFC 3161 timestamping authorities for data integrity.
Preparing Your Repository
Create a GitHub repository with your eLabFTW configuration.
Repository Structure
elabftw-deploy/├── Dockerfile├── config/│ └── elabftw.yml├── nginx/│ └── default.conf└── .dockerignoreCreating the Dockerfile
Create a Dockerfile for your eLabFTW deployment:
FROM elabftw/elabimg:latest
# Copy custom configuration if neededCOPY config/ /etc/elabftw/
# Copy nginx configurationCOPY nginx/default.conf /etc/nginx/conf.d/default.conf
# Create necessary directoriesRUN mkdir -p /elabftw/uploads /elabftw/cache
# Set permissionsRUN chown -R nginx:nginx /elabftw
# Expose web portEXPOSE 443
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD curl -fsk https://localhost/login.php || exit 1
# Use default entrypoint from base imageCreating eLabFTW Configuration
Create config/elabftw.yml:
# eLabFTW configuration# Environment variables override these settings
# Database settingsdb_host: ${DB_HOST}db_name: ${DB_NAME:-elabftw}db_user: ${DB_USER}db_password: ${DB_PASSWORD}db_port: ${DB_PORT:-3306}
# Server settingsserver_name: ${SERVER_NAME:-localhost}disable_https: falsesecret_key: ${SECRET_KEY}
# Email settingsmail_method: smtpsmtp_address: ${SMTP_HOST}smtp_port: ${SMTP_PORT:-587}smtp_encryption: tlssmtp_username: ${SMTP_USER}smtp_password: ${SMTP_PASSWORD}
# Storage settingsuploads_folder: /elabftw/uploads
# Security settingscookie_secure: trueCreating Nginx Configuration
Create nginx/default.conf:
server { listen 443 ssl http2; server_name _;
# SSL configuration ssl_certificate /etc/nginx/certs/server.crt; ssl_certificate_key /etc/nginx/certs/server.key;
root /elabftw/web; index index.php;
# Security headers add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header X-XSS-Protection "1; mode=block" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# Upload size limit client_max_body_size 100M;
location / { try_files $uri $uri/ /index.php?$query_string; }
location ~ \.php$ { fastcgi_pass unix:/var/run/php-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_read_timeout 300; }
# Deny access to sensitive files location ~ /\.ht { deny all; }
location ~ /\. { deny all; }}Creating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdLICENSE.gitignore.DS_StoreDeploying eLabFTW on Klutch.sh
Follow these steps to deploy your eLabFTW instance:
- A managed MySQL service
- A separate Klutch.sh deployment
- Select HTTP as the traffic type
- Set the internal port to 443
Set Up a MySQL Database
eLabFTW requires MySQL/MariaDB. Set up a database through:
Note the connection details for environment variables.
Generate a Secret Key
Generate a secure secret key for eLabFTW:
openssl rand -base64 32Configure Email Settings
Gather your SMTP server details for sending email notifications.
Push Your Repository to GitHub
Initialize and push your configuration:
git initgit add .git commit -m "Initial eLabFTW configuration"git remote add origin https://github.com/yourusername/elabftw-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project for your laboratory notebook.
Create a New App
Create a new app within your project and connect your GitHub repository.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Configure the following environment variables:
| Variable | Value |
|---|---|
DB_HOST | Your MySQL host |
DB_NAME | elabftw |
DB_USER | Your database username |
DB_PASSWORD | Your database password |
SECRET_KEY | Your generated secret key |
SERVER_NAME | your-app.klutch.sh |
SMTP_HOST | Your SMTP server |
SMTP_PORT | 587 |
SMTP_USER | SMTP username |
SMTP_PASSWORD | SMTP password |
Attach Persistent Volumes
Add persistent volumes for eLabFTW:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/elabftw/uploads | 100 GB | Uploaded files and attachments |
/elabftw/cache | 5 GB | Application cache |
Size uploads volume based on expected data volume.
Deploy Your Application
Click Deploy to build and start eLabFTW.
Complete Installation
Access your eLabFTW instance at https://your-app-name.klutch.sh/install/ to complete the installation wizard.
Create Admin Account
During installation, create the Sysadmin account that will manage your eLabFTW instance.
Initial Setup and Configuration
Completing the Installation
The installation wizard guides you through:
- Database connection verification
- Sysadmin account creation
- Initial configuration settings
- Email testing
Creating Teams
Organize your laboratory with teams:
- Log in as Sysadmin
- Go to Sysadmin Panel
- Navigate to Teams
- Create teams for different research groups
Adding Users
Add researchers to your eLabFTW instance:
- Users can self-register (if enabled)
- Or Sysadmin can create accounts directly
- Assign users to appropriate teams
- Set user permissions (User, Admin, Sysadmin)
Configuring Team Settings
As Team Admin, configure team-specific settings:
- Default experiment templates
- Status options for experiments
- Team visibility settings
- Shared resources
Managing Experiments
Creating Experiments
Researchers create experiments by:
- Click “Create” from the experiments view
- Enter a title and description
- Use the rich text editor for detailed documentation
- Attach files, images, and protocols
- Add tags for organization
Rich Text Editor
eLabFTW provides a full-featured editor:
- Formatting: Bold, italic, headings, lists
- Tables: Data tables with formatting
- Images: Embed images directly in text
- Code: Syntax-highlighted code blocks
- Math: LaTeX equation support
File Attachments
Attach files to experiments:
- Images and figures
- Raw data files
- Analysis scripts
- Supplementary documents
Linking Experiments
Create relationships between experiments:
- Link related experiments
- Reference previous work
- Build experiment chains
Timestamping
Enable cryptographic timestamps:
- Configure a timestamping authority in settings
- Timestamp experiments to prove creation date
- Timestamps are cryptographically verified
Protocol Database
Creating Protocols
Build a library of reusable protocols:
- Navigate to the Database section
- Create a new item with category “Protocol”
- Document the procedure in detail
- Add required materials and equipment
Using Protocols in Experiments
Reference protocols in experiments:
- Link protocols to experiments
- Create experiments from protocol templates
- Document any deviations from protocols
Sharing Protocols
Share protocols across teams:
- Set protocol visibility to “Organization”
- Teams can view and use shared protocols
- Maintain version history
Scheduling and Resources
Equipment Booking
Use the scheduler for resource management:
- Define schedulable resources (equipment, rooms)
- Researchers book time slots
- View availability calendar
- Avoid scheduling conflicts
Calendar Integration
Export schedules to external calendars:
- Subscribe to iCal feeds
- Sync with Google Calendar or Outlook
- Get notifications for bookings
Data Export and Compliance
Exporting Experiments
Export data in various formats:
| Format | Use Case |
|---|---|
| Archival and printing | |
| ZIP | Complete backup with attachments |
| ELN | Standard electronic notebook format |
| JSON | Data integration |
Compliance Features
eLabFTW supports regulatory compliance:
- Audit Trails: Track all changes to experiments
- Timestamps: Prove data creation dates
- Signatures: Electronic approval workflows
- Data Integrity: Checksums for file verification
Data Retention
Configure data retention policies:
- Set experiment archival rules
- Export data for long-term storage
- Maintain compliance with institutional requirements
API Integration
REST API
eLabFTW provides a comprehensive API:
# Get experiment listcurl -H "Authorization: $API_KEY" \ https://your-elabftw.klutch.sh/api/v2/experiments
# Create experimentcurl -X POST \ -H "Authorization: $API_KEY" \ -H "Content-Type: application/json" \ -d '{"title": "New Experiment"}' \ https://your-elabftw.klutch.sh/api/v2/experimentsAPI Keys
Generate API keys for integration:
- Go to User Panel > Settings
- Generate an API key
- Use the key for authenticated requests
Integration Examples
- LIMS Integration: Sync sample data
- Automation: Create experiments from instruments
- Backup: Automated data export
Production Best Practices
Performance Optimization
- Redis Cache: Enable Redis for improved performance
- File Storage: Use fast SSD storage for uploads
- Database: Optimize MySQL for your workload
Security Recommendations
- Strong Passwords: Enforce password policies
- 2FA: Enable two-factor authentication
- Access Control: Use granular permissions
- Regular Updates: Keep eLabFTW updated
Backup Strategy
Regular backups should include:
- MySQL database dump
- Uploads directory
- Configuration files
Implement a 3-2-1 backup strategy:
- 3 copies of data
- 2 different storage types
- 1 offsite backup
Troubleshooting Common Issues
Cannot Log In
Symptoms: Login fails or redirects.
Solutions:
- Verify database connection
- Check session configuration
- Clear browser cookies
- Review PHP error logs
Uploads Failing
Symptoms: File uploads fail or timeout.
Solutions:
- Check upload directory permissions
- Verify PHP upload limits
- Ensure adequate disk space
- Review nginx client_max_body_size
Email Not Sending
Symptoms: Notifications not received.
Solutions:
- Test SMTP connection
- Verify credentials
- Check firewall rules
- Review email logs
Slow Performance
Symptoms: Pages load slowly.
Solutions:
- Enable Redis caching
- Optimize database queries
- Increase PHP memory limit
- Check server resources
Additional Resources
- eLabFTW Documentation
- eLabFTW GitHub Repository
- eLabFTW Official Website
- eLabFTW API Documentation
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying eLabFTW on Klutch.sh gives your research laboratory a professional, secure electronic lab notebook with full data ownership. The combination of eLabFTW’s research-focused features and Klutch.sh’s container management means you can document experiments, manage protocols, and maintain compliance without complex IT infrastructure.
With timestamping for data integrity, comprehensive audit trails, and flexible collaboration features, eLabFTW supports good laboratory practices while making daily research documentation efficient and organized. Whether you’re a small research group or a large institution, eLabFTW on Klutch.sh provides the foundation for modern, digital research documentation.