Since the official ShareLaTeX documentation is primarily written with Ubuntu 12.04 LTS in mind, I tried to re-build the provided .deb from scratch using Ubuntu 14.04 TLS with the least amount of non-standard or non-packaged software.
Here are all the steps that were required (with sudo since Ubuntu doesn't want you to be root).
First, install lots of packages - note that no additional repositories are required! (Dependencies):
$ sudo apt-get update
$ sudo apt-get install git build-essential curl python-software-properties zlib1g-dev zip unzip
$ sudo apt-get install ruby-dev
$ sudo apt-get install nodejs npm
$ sudo apt-get install redis-server
$ sudo apt-get install mongodb
$ sudo apt-get install aspell
$ sudo apt-get install texlive latexmkTo satisfy grunt, we need to have an executable called node:
$ sudo ln -s `which nodejs` /usr/local/bin/nodeAdditionally, we need some packages through external package managers:
$ sudo npm install -g grunt-cli
$ sudo gem install fpmNow there might be a ~/tmp directory owned by root. We need to remove that so we can continue as a normal user:
$ sudo rmdir ~/tmpNow we can clone the repository and install all additional dependencies (Setting up a Development Environment, make sure to check out the release branch, as per #comment-1346019):
$ git clone -b release https://github.com/sharelatex/sharelatex.git
$ cd sharelatex
$ npm installNow we can install the actual ShareLaTeX services:
$ grunt installAfter that is done, we can run the provided sanity check:
$ grunt check --force
[...]
Running "check:latexmk" task
Checking latexmk is installed... >> FAIL.
>> latexmk version is too old (4.35). Must be 4.39 or greater.
>> This is a not a fatal error, but compiling will not work without latexmk
Warning: latexmk is too old Use --force to continue.
[...]In my case, it complained about latexmk being too old, but I ignored that for now, compiling simple LaTeX documents seemed to work anyway.
Now you need to apply the patch below to change one of the dpkg dependencies since the package in the official Ubuntu repositories is called just mongodb instead of mongodb-org:
$ wget https://gist.githubusercontent.com/moschlar/2b941f75a44fbac69993/raw/mongodb-dep.patch
$ patch -p1 < mongodb-dep.patchAfter that, we create a huge .deb package:
$ grunt build:debThen it should be sufficient to run
$ dpkg -i sharelatex_0.0.1_amd64.deb(Installing on Ubuntu 12.04 from dpkg (.deb)) and your ShareLaTeX should be running on http://localhost:3000.
And finally, as you might guess, if you want to use Nginx as a Reverse Proxy, you don't need no external repository, the packaged version in the Ubuntu repository is recent enough:
$ sudo apt-get install nginx
I had to install the following package before 'npm install' would run without error:
( The error was 'make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1' )
sudo apt-get install libkrb5-dev
The afore mentioned problem with the fix can be solved (as stated by wngr) by reverting the removal of the patch with:
git revert c96d713
After the revert one can procede with patching the file according to the instractions above.