Public Repository

Last pushed: 4 hours ago
Short Description
HHVM running as an HTTP server on Ubuntu
Full Description

HHVM is installed and running as a web server (via Proxygen).

  • it listens on port 80
  • both the default document and 404 document are index.php
  • it serves out of /var/www/public, however the bulk of your code should not be in the public webroot - adding a public/ subdirectory to your project and installing your project to /var/www is the most common approach, described below. More information is available in the documentation.
  • additional ini settings can be specified by replacing /etc/hhvm/site.ini

Development Usage

$ cd mysite
# with a randomly assigned port...
$ docker run --name=my_container -v $(pwd):/var/www -d -P hhvm/hhvm-proxygen:latest
$ docker port my_container 80 # to find out what port was allocated
# ... or, on port 12345
$ docker run --name=my_container -v $(pwd):/var/www -d -p 12345:80 hhvm/hhvm-proxygen:latest

Production Usage

I recommend building your own Docker image derived from this by specifying a new Dockerfile:

FROM hhvm/hhvm-proxygen:latest

RUN apt-get update -y && apt-get install -y curl
# Install composer
RUN mkdir /opt/composer
RUN curl -sS | hhvm --php -- --install-dir=/opt/composer

# Install the app
RUN rm -rf /var/www
ADD . /var/www
RUN cd /var/www && hhvm /opt/composer/composer.phar install

# Reconfigure HHVM
ADD /etc/hhvm/site.ini


Deploy the image with your preferred hosting solution; this has been tested with AWS Elastic Beanstalk - simply eb config; eb init; eb create; eb deploy (see

Warning: If you are using AWS Elastic Beanstalk to build and deploy the images, it will build your images on the same instances used for serving the site. This may lead to memory issues.

Disabling The Typechecker

HHVM automatically runs the typechecker - this is useful in development, but assuming you have it running in your development workflow and in your CI system, there is not much additional benefit to running it in production, and the increased memory usage can be costly in production. To disable it, add the following to /etc/hhvm/site.ini:


Error Logs

Errors are written to stderr, so can be accessed with docker logs my-container, or docker logs -f my_container to keep watching.


  • specific versions of HHVM are tagged, eg 3.8.0.
  • latest points at the latest stable release
  • additional tags will be added for future LTS releases of HHVM with Proxygen support, eg 3.9-lts-latest

About /var/www/public

Most popular projects have index.php in the top level of their source tree, so should be deployed to /var/www/public - unfortunately, this is generally considered bad practice nowadays because having the root of your webapp publicly accessible makes it very easy to accidentally make things public that you do not mean to - for example, configuration files with database credentials, or your .git directory.

If you are working on a new project, consider a structure like:

myapp/src/ # if you don't like PSR-4
myapp/mynamespace/mysubnamespace/ # if you do like PSR-4

Then map myapp/ to /var/www instead of /var/www/public.

If you agree in principle but dislike the name, you can override the hhvm.server.source_root path in /etc/hhvm/site.ini in your container.

For more details, see the documentation.

Source Please

Docker Pull Command