Skip to main content
Table of contents


Local frontend development

Make the following changes to your setup if you are making changes to frontend apps and need to view those changes locally.

In the instructions below we are running the frontend app, but this would work for any of the other frontend apps such as government-frontend.

Running just a frontend app against live data

cd /var/govuk/frontend
./ --live

Running a frontend app against changes in govuk_publishing_components

Update the Gemfile for the frontend app to point to your local govuk_publishing_components gem:

gem 'govuk_publishing_components', path: '../govuk_publishing_components'

Then run your frontend app again pointing to live:

./ --live

Running a frontend app against changes in static

Make changes to the Gemfile of the frontend app you’re working on as per changes to govuk_publishing_components above, then set in development.rb:

config.assets.debug = false

If you’re making changes to the govuk_publishing_components gem that affect static and are likely things across the whole site, e.g: cookie banner (and survey banner possibly), update the Gemfile of static to point to the gem:

gem 'govuk_publishing_components', path: '../govuk_publishing_components'

Run up static:

cd /var/govuk/static
govuk_setenv static ./ --live

Run up frontend against local static (the --live flag means the rest runs against live data):

PLEK_SERVICE_STATIC_URI=localhost:3013 ./ --live

And you can see frontend running up locally with the right local dependencies:

Note: You might sometimes find that you have something running on a port still, which stops you from starting up an app. To kill a process running on a port:

# replace [port number]
sudo fuser -k [port number]/tcp
This page was last reviewed on 8 July 2019. It needs to be reviewed again on 8 January 2020 by the page owner #govuk-2ndline .
This page was set to be reviewed before 8 January 2020 by the page owner #govuk-2ndline. This might mean the content is out of date.