2.7 KiB
Raw Permalink Blame History


A basic container for a private MediaGoblin media server (, including Nginx and uWSGI. Assumes a separate PostgreSQL database for persistence, and an email host for sending email notifications.

Hosted at

Environment variables

  • NOTIFICATION_EMAIL: From address for MediaGoblin notification emails.
  • EMAIL_HOSTNAME: Hostname used to send outgoing notification emails.
  • EMAIL_PORT: Port number used to send outgoing notification emails.
  • EMAIL_USERNAME: Username used to connect to outgoing email host.
  • EMAIL_PASSWORD: Password used to connect to outgoing email host.
  • EMAIL_TLS_SSL: "true" or "false" for using TLS/SSL encryption for sending emails.
  • EMAIL_STARTTLS: "true" or "false" for using STARTTLS encryption for sending emails.
  • DATABASE_URL: Connection string for database to use for persistence, including credentials. See example below.


  • /app/user_dev: Location to store user media uploads.



$ sudo docker run --detach --name=mediagoblin \
    --env \
    --env \
    --env EMAIL_PORT=587 \
    --env \
    --env EMAIL_PASSWORD=pass \
    --env EMAIL_TLS_SSL=false \
    --env EMAIL_STARTTLS=true \
    --env DATABASE_URL=postgresql:// \
    --volume /var/lib/mediagoblin/user_dev:/app/user_dev \
    --publish 80:80 \

User management

Since this image is for running a private MediaGoblin server, user self-registration is disabled. So, to add a user, first exec into the running Docker image:

$ sudo docker exec -it mediagoblin bash

Where mediagoblin is the name of your running Docker container. If you dont know the name to use, try looking in docker ps output.

Then, add a user (follow the prompts):

# su - mediagoblin
$ gmg --conf_file /app/mediagoblin_local.ini adduser

Finally, if you want to make the new user into an admin user:

$ gmg --conf_file /app/mediagoblin_local.ini makeadmin username

Where username corresponds to the user you added above.

Local development

To build the image locally, run:


And then to run the image:


Connect to http://localhost:8080 to view the running instance in your browser.