self-hosted lab
I document useful local self-hosted services and tips for running a lab.
Proxmox server
I hosted a PC server for several services, most importantly the wiki and Overleaf for the lab. I installed Proxmox to manage Virtual Machines. Each service runs in its own Virtual Machine (Ubuntu Server). Mostly, I use Docker images to run the services for simple maintenance. I have an additional VM for reverse proxy that redirects domain name to the other server.
1. Lab wiki
The wiki is a shared knowledge base for lab members. Content includes onboarding information, equipment manuals, example code, and research tips.
I am using An Otter Wiki because I like its Markdown editor and simple interface, which works well on a mobile device and with light & dark themes. One can also easily copy and paste images into the editor.
You can customize its CSS to match your lab style. You can set up a gmail server for account creation.
I used Docker to run the service; you can follow Using docker compose section in Installation.
A limitation of such wiki is that you cannot specify permission for individual pages. Everyone sees the same wiki. More comprehensive alternative includes dokuwiki.
2. Lab Overleaf
I use LaTeX templates for writing papers, and while Overleaf allows easy collaboration, I would like to run it on my own server rather than Overleaf (not affected by outrage or collaboration limitation).
There are different versions of open-source Overleaf:
- Community Edition: The original open-source Overleaf. I initially set this up but found this lacks account management, which is quite essential. You can create accounts but you cannot reset passwords. Do not recommend.
- Community Edition Extended (overleaf-cep): This is the one that I finally use, which has a lot of functions in the premium version of Overleaf too (account management, comments, edit suggestions, history, Zotero integration).
For Proxmox VM, you need to change VM’s CPU to host in order to enable AVX function that is required by Mongo, the database that Overleaf uses.
The installation of overleaf-cep can be a bit more complicated. First, clone the original Overleaf, then override the image.
git clone https://github.com/overleaf/toolkit.git overleaf-toolkit
cd overleaf-toolkit
./bin/init
docker pull overleafcep/sharelatex:6.2.0-ext-v5.0
Then update config/docker-compose.override.yml:
---
services:
sharelatex:
image: overleafcep/sharelatex:6.2.0-ext-v5.0
Some additional settings:
In config/overleaf.rc:
- OVERLEAF_LISTEN_IP to local IP, e.g., 192.168.0.X.
In config/variables.env:
- Change the name of the site,
OVERLEAF_APP_NAME - Disable registration by
OVERLEAF_ENABLE_REGISTRATION_PAGE=false - Update
OVERLEAF_SITE_URLso that the registration email URL is correct - And add email function in the series of
OVERLEAF_EMAIL_SMTP_*variables for account creation
Run the service:
bin/up -d
Now Overleaf should be running.
Compile ACM templates
To compile ACM template, you need to install more packages. Here is the way to install all LaTeX packages, referring to Overleaf Doc: Upgrading TeX Live.
Note that for the last step, you can commit the change as the following (and keep config/version as 6.2.0):
docker commit sharelatex overleafcep/sharelatex:6.2.0-ext-v5.0-with-texlive-full
The effect should be immediate.
Link Zotero
You can also link to a Zotero account for syncing bib files. Note that you can only link to one account. Follow Zotero Integration to set up. After setup, restart the docker service and you should be able to an additional menu appear in file upload.
Self-hosted Overleaf is fast and works pretty flawlessly (yes we’ve done a full submission using it).
Synology Drive
I have a Synology Drive as lab drive for:
1. Lab files
Synology drive to host projects and other lab files. Note to configure DDNS rather than QuickConnect so it’s much faster.
2. Backup
You can backup Proxmox VMs, PC, or cloud. This can be done by using Synology’s built-in Active Backup for Business. Remember to enable dedicated certificate in settings to backup would not be disturbed.
Things that are hosted elsewhere
Unfortunately, there is a routine power shutdown in the department; it is also quite slow to access from abroad.
I host the lab website and other websites on Google Firebase.