This guide is about setting up Sharelatex in a Docker container with https connection.
Install Docker
Here two examples of installing the Docker deamon. The required Packages are docker and docker-compose.
Arch Linux
yay -S docker docker-compose
Debian / Ubuntu
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
Enable Service
To enable the service as background task simply run
sudo systemctl enable docker
sudo systemctl start docker
Setup Sharelatex Container
1. Create Virtual Docker Network
sudo docker network create main
2. Configure Docker-Compose File
In the Docker-Compose File you must change several values to your custom needs.
The specific lines to change are commented.
3. Set Password for Proxy Page
You need to paste the output in line 43 of the Docker compose file.
echo $(htpasswd -nb username password) | sed -e s/\\$/\\$\\$/g
Example:
- "traefik.http.middlewares.traefik-auth.basicauth.users=test:$$apr1$$.LOxTF4y$$/OjdUK3pSGiT/flYY42uS1"
4. Install Latex Packages
First of all, the package manager must be installed including all Latex Packages. The package manager of Latex is called tlmgr.
Run Docker Container:
To run the Sharelatex Server enter
sudo docker-compose up -d
Create User:
Enter your own E-Mail address to this command
docker exec sharelatex /bin/bash -c "cd /var/www/sharelatex; grunt user:create-admin --email=max@test.com"
Install Packages:
If the Sharelatex Container is running enter following commands
sudo docker exec sharelatex wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
sudo docker exec sharelatex tar xvfz install-tl-unx.tar.gz
Then open the Bash Console of the container
docker exec -ti sharelatex /bin/bash
- Change directory:
cd install-tl-XXX
- Change rights:
chmod u+x install-tl
- Run
./install-tl
- Wait until everything is installed
-
exit
the Bash Shell of the container
Update Packages:
Now check the tlmgr (Latex Package Manager) for updates
docker exec sharelatex tlmgr update
Important Docker Commands
Start Container
sudo docker-compose up -d
Run without -d
if you want to see the console output.
Stop Container
sudo docker-compose down
Reload Docker-Compose File
When Container Stopped
sudo dokcer-compose up --force-recreate -d
Top comments (0)