Because I rarely needed to use LaTeX, I used to use EC2 for compiling my documents. I liked that I could throw everything away when I was done, but the setup was time consuming. I found a better way.
Docker is a great tool for this because you don't have to make any changes to your main system. Here is a way to use a Docker image I created.
docker run -i richardbronosky/latex-compiler < document.tex > document.pdf
If you need supplementary files you can pipe in an uncompressed tar and it will be detected.
tar cf - *.tex *.sty | docker run -i richardbronosky/latex-compiler > document.pdf
If multiple documents to be created, it returns a tar file that you can expand.
tar cf - *.tex *.sty | docker run -i richardbronosky/latex-compiler --tar | tar x
If you need more (or less) LaTeX packages, you can clone the repo and modify the Dockerfile. Its current state is:
MAINTAINER Bruno Bronosky <firstname.lastname@example.org>
RUN apt-get update
RUN apt-get install -y texlive-latex-recommended
ADD latexcat /usr/local/bin/latexcat
RUN chmod a+x /usr/local/bin/latexcat