This self-hosted Microsoft Word alternative isn't for the faint of heart, but it's better than every other out there

1 month ago 4

We're all familiar with Microsoft Word, Google Docs, and the various offshoot free and open-source tools that allow you to do the same thing but in your own controlled environment. However, many aren't familiar with LaTeX, which can essentially be summed up as a programming language that you can use to make documents. LaTeX is so powerful that many academic papers are written using it, and some universities require it for a dissertation or thesis, which was the case for me. Overleaf is by far the best way to create documents in that format, and you can self-host it for free.

Overleaf is, more or less, a Google Docs but for LaTeX. You can use the online version for free, but self-hosting it gives you a considerably better experience with faster compilation times and collaborative features available for free. Plus, you can edit it in any way that you'd like, so you can make it truly your own over time. Overleaf is how I make all of my documents and has been for years, and I recently made the switch to a self-hosted version for these reasons.

The only downside of self-hosting Overleaf is the difficulty in doing so. The company's documentation isn't particularly helpful when hosting it in an environment such as Dockge or Portainer. I eventually found a Docker Compose file and steps that worked for me, and I made some modifications to it. I stripped out all email-related settings and added "EMAIL_CONFIRMATION_DISABLED: true" to the environment section so that my account was instantly verified, while also swapping the volume mounts out for my own storage paths instead.

It's a lengthy process, but if you can get it up and running, Overleaf is by far the best self-hosted document creator. While many do tout it as a Microsoft Word alternative, both software can be used side by side. Overleaf is great for precise documents that require a consistent, careful format, like CVs, cover letters, and other important documents. Word, meanwhile, is great for quick and easy documents that get the job done.

An image of a monitor with Scrivener open and running.

Related

5 word processors more useful than Microsoft Word

Just because Word is popular doesn't make it the best

Self-hosting Overleaf can be difficult

It took me a while

overleaf-self-hosted-2

As already mentioned, I had some trouble getting Overleaf up and running. The official Docker Compose file didn't work for me. I had initially thought it was because of the mongodb-init-replica-set file not being instantiated correctly, but that didn't turn out to be the issue either. That's when I found the other guide linked above and went with that instead. I disabled all email functionality as I didn't want it, and it's worked fine. The most annoying part of the process, after figuring that out, was creating a user in the first place. I needed to open a shell in my Overleaf container and run the following command after entering the /overleaf/services/web folder:

node modules/server-ce-scripts/scripts/create-user --admin --email=email@email.com

Once I had done that, about a minute later, a link came up in the terminal that I could use to create the account. I copied this out, changed "localhost" to be my server's IP and port, and could then set up my account as a normal user. The entire process took quite a while, and if you face consistent issues, it might be worth simply using the online version of Overleaf instead. Finally, we'll need to update the internal packages so that everything's up to date and you can use more advanced features and templates.

Updating the Overleaf latex files

Open a shell in your Overleaf container again, and run the following command:

tlmgr update --self

Once that's done, then run this next command:

tlmgr install scheme-full

This'll take some time to run, but everything should be up to date after, and it'll work just as you'd expect Overleaf to regularly work. I actually discovered this problem when I installed Overleaf and tried to compile the default template that comes with it, which was yet another frustrating part of the process to solve after I had thought I finally got it all working. I had thought this was an issue with the template at first, but other templates I knew worked on Overleaf were failing, too.

Overleaf CV template

Once that finished, my templates worked as they should, and I could compile them and try them out. I'm now in the process of migrating my Overleaf data from the regular online version of Overleaf to my self-hosted instance, and I'm looking forward to controlling all of my documents, especially with how much I use LaTeX for everything when I can.

After all that hardship, having a fully working self-hosted Overleaf that I can use to store important documents and even share them with other users is fantastic. I've already set up my reverse proxy to point to it, and I'm also planning to link it to my Paperless-NGX flow... somehow... so that I can keep my documents in there too.

What can Overleaf do?

It's fantastic for all kinds of documents

Showing a test document in a self-hosted Overleaf instance

Overleaf is basically a pretty front-end for LaTeX, but it has a few advantages over a regular TeX editor that you might install on your PC. It's a visual editor with syntax highlighting, so that you can instantly see why your document might not compile, and you can fix it. Not all syntax errors will prevent you from compiling your document, either, and I'm guilty of ignoring some of them when I achieve the desired output. It's a precise document formatting language, and you can save your own templates for later usage in similar documents.

For example, if you create invoices and want a standard format, you can create an invoice format and simply change the customer details, item information, and other details required. You can download each individual PDF and rename it locally, or make a copy of your template every time you want to draw up a new invoice in LaTeX. Plus, things like today's date can be automated using the LaTeX datetime package, so you can instantly have the correct date included. There are so many cool packages you can use, and years after completing my degree, LaTeX is one of the top skills I learned to use as a result of it being required for my Bachelor's thesis.

I like to take control of my data where I can, which is why self-hosting Overleaf was on my bucket list of things to do. It took a while and some troubleshooting, but I hope that the information I've shared here can make it easier for others who may be looking to do the same thing. It's worth it, and given how powerful Overleaf and LaTeX are, I'm glad that this is a piece of software that the company gives to users for free (and with instructions!) to self-host, too.

Read Entire Article