Moving Ghostwriter into production with Nginx and HTTPS

Moving to Production

Eventually you will want to move Ghostwriter from a development server to a production server.

Even though Ghostwriter could be run in developer mode forever, it is much better to use HTTPS and take some of the workload off of Django when it comes to hosting files.

Adjusting Production setting

Start your move to production by opening .envs\.production\.django. The SECRET_KEY variable is set to changeme. Generate a new value and drop in the new key. It is usually something like:


The default configuration will host Ghostwriter on with HTTPS.

If you would like to modify the listening port or anything else within the Nginx configuration, open compose/production/nginx/nginx.conf. You can make changes to this configuration file like you would for any Nginx configuration.

Production deployments use separate settings from local deployments, so make changes to .envs/.production/.django and .../.postgres as desired.

You can keep separate settings for your local/development and production deployments.

Using a Domain Name

You may wish to use a domain name instead of an IP address once you move Ghostwriter into production. By default, Ghostwriter's production deployment only allows the server to be accessed using ghostwriter.local and localhost.

Open your .envs/.production/.django file and uncomment the ALLOWED_HOSTS value to make modifications.

Deploy to Production

Deploy Ghostwriter in production mode using Docker Compose and the production.yml file.

docker-compose -f production.yml stop; docker-compose -f production.yml rm -f; docker-compose -f production.yml build; docker-compose -f production.yml up -d