
Overleaf is an open-source online LaTeX editor. With the help of Overleaf, students and academics can work together on a single LaTeX document to produce high-quality output.
This article walks through installing Overleaf Community Edition on a Vultr Ubuntu 20.04 LTS server instance.
If you are hosting example.com on Vultr, set up DNS records as follows to point example.com and www.example.com to the IPv4 address of your server instance (203.0.113.100) in the DNS tab of the Vultr control panel:
If you are hosting example.com on other platforms, instructions on setting up DNS records may vary.
Learn more about managing DNS through Vultr in an article on Vultr DNS.
Use an SSH terminal to log in to the server instance as root, and then follow the instructions listed in this section to harden the system.
Determine if any swap file or swap partition exists in the system:
If so, feel free to move on. If not, set up a swap file of 2GB to smooth the operation of the system:
Change the preset password of root to a new, strong, and private password (Say it is r00tyHvM%2ka$8E3):
Create a normal user named overleaf with sudo privileges, and then set up a strong password for the sudo user. Say the password is sud04QeXbcx#6&Cw:
Setup UFW firewall rules, allowing only traffic on SSH (22), HTTP (80), and HTTPS (443) ports:
Update the system and then reboot the machine:
After the server instance gets up and running again, log in as the sudo user overleaf to move on.
Uninstall any earlier versions of Docker in the system, if they exist:
It's OK to see the system prompts E: Unable to locate package docker-engine.
Install dependencies for setting up the Docker Engine Advanced Packaging Tool (APT) repository:
Get the official Docker GPG key:
Setup the APT repository for the stable release of Docker Engine:
Install Docker Engine and containerd:
To control Docker Engine as a non-root user, add the current normal user overleaf to the docker group:
Configure Docker Engine to enable automatic log rotation, restricting disk space usage of the Docker Engine log files:
Populate the file with:
Press Ctrl+O, Enter, and Ctrl+X to save the file and quit.
Start the Docker service and configure it to start on boot:
Start the containerd service and configure it to start on boot, too:
Verify the installation of Docker Engine:
To test the functionality of Docker, Use Docker to run a "hello world" image:
As required by Overleaf, install the latest stable release of Docker Compose V1.x as follows:
Optionally, install Docker Compose command completion for Bash:
Confirm the installation of Docker Compose v1.x:
Note: The above instructions are only for installing Docker Compose 1.29.2. Be sure to find out if a newer version of Docker Compose is available on the official Docker Compose installation page.
The officially recommended tool for installing Overleaf is the Overleaf Toolkit which consists of a series of scripts wrapping around the Docker Compose program.
Use git to download Overleaf Toolkit:
Initialize Overleaf local environment with the --tls flag to enable Transport Layer Security (TLS):
Running the above script generates a self-signed TLS certificate in /opt/overleaf/config/nginx/certs/overleaf_certificate.pem and the paired private key in /opt/overleaf/config/nginx/certs/overleaf_key.pem. Replace them with your own ones if necessary, but be sure to keep the same file names and the same permissions on them.
Set environment variables for running Overleaf Community Edition behind the Nginx TLS proxy:
Find the two lines listed below:
Uncomment them:
Optionally, edit lines listed below to customize the interface of your Overleaf site:
Example modifications:
Press Ctrl+O, Enter, and Ctrl+X to save the file and quit.
Note: This article omits instructions on how to update SMTP-related settings stored in the same file, because Vultr blocks the SMTP port 25 on each server instance by default according to its anti-spam policy. Contact Vultr customer service to remove the restriction if you do need to enable SMTP email sending on your server instance.
Edit Nginx-related settings in another Overleaf configuration file:
Find the lines listed below:
Replace them with:
Press Ctrl+O, Enter, and Ctrl+X to save the file and quit.
Run all the Overleaf Docker services in background:
After all Docker services are up and running, point your favorite web browser to the following URL to egister the first administrator account.
When using a self-signed certificate, your web browser, such as Chrome, will warn you that your connection is not private. Feel free to ignore the security alert. Click the Advanced button, and then the Proceed to www.example.com (unsafe) link to visit the Overleaf registration page.
On the Overleaf registration page, input your email address and password, and then click the Register button to finish the registration of the first administrator. Click the Log in here link to go to the Log In page, and then use the administrator's credentials to log in.
By default, the Overleaf Docker image only includes a minimal installation of TeX Live to save bandwidth. Follow the instructions in this section to update TeX Live to a complete installation.
While Overleaf is running, use the commands below to start a shell inside the Overleaf container:
The prompt will turn into something that looks like root@4945b4907b6f:/#.
Update the tlmgr program:
Optionally, find the URL of the nearest Comprehensive TEX Archive Network (CTAN) repository location from the https://ctan.org/mirrors site, such as https://mirrors.mit.edu/CTAN/, and then change the default repository location as follows:
Update TeX Live to a complete installation in the background, combining with the nohup command to prevent update failure caused by any accidental SSH disconnection:
Downloading and installing all the TeX Live packages (more than 4,000 packages) may take a while. Use the command listed below to check for the progress at any time:
Until you see the output ends at:
Having all the TeX Live packages in place, update them to the latest versions:
Exit the shell inside the Overleaf container:
To make your changes to the Overleaf container persistent, use the command listed below to save the changes:
Set up an overriding Docker Compose configuration file to reflect the changes:
Populate the file with:
Press Ctrl+O, Enter, and Ctrl+X to save the file and quit.
Note:
Finally, stop the running Docker services, delete the former ShareLaTeX container, and then restart the Overleaf Docker services:
Depending on the specific languages you plan to use, you must select the proper LaTeX compiling engine and fonts when typesetting your documents with Overleaf. To learn more about configuring Overleaf for typesetting documents in the languages you prefer, visit the Overleaf Documentation page.
0 Comments
Be the first to comment and share your perspective with the community.