From GNU MediaGoblin Wiki
Revision as of 23:35, 15 May 2020 by Mconnell (Talk | contribs)

Jump to: navigation, search

Inventory of single step installation of MediaGoblin for demonstration purposes.




While MediaGoblin has no official Docker image, mtlynch maintains the most up-to-date version.

To run it:

 docker run \
   --tty \
   --detach \
   --publish 8080:6543 \
   --name mediagoblin \

Visit http://localhost:8080 in your browser to see your Dockerized MediaGoblin instance.

Admin credentials are:

  • Username: admin
  • Password: admin

For full details on running the Docker image or rebuilding your own custom image, see https://github.com/mtlynch/mediagoblin-docker.

Docker behind nginx

The following may be useful for users running a MediaGoblin docker container behind an nginx reverse proxy, eg. for handling SSL.

Nginx virtual server definition

Note that the port number in the proxy_pass must match the port number you use when starting the container. See the shell script in the next section.

You will want to edit the host name to use your own, as well.

You may also change the client_max_body_size to a value you deem appropriate for your server.

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic

server {
    if ($host = mediagoblin.example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80 ;
    listen [::]:80 ;
    server_name mediagoblin.example.com;

    access_log /var/log/nginx/mg.access_log ;
    error_log /var/log/nginx/mg.error_log ;


server {
   listen 443 ;
   listen [::]:443 ;
   server_name mediagoblin.example.com;

   # needed to actually upload any files.
   client_max_body_size 32M;

   access_log /var/log/nginx/mg.ssl_access_log ;
   error_log /var/log/nginx/mg.ssl_error_log ;

   location / {
        proxy_set_header X-Forwarded-Host $server_name;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-For $remote_addr;

    ssl_certificate /etc/letsencrypt/live/mediagoblin.example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mediagoblin.example.com/privkey.pem; # managed by Certbot

Docker container start/stop/update script

This shell script is essentially a wrapper around the example docker run statement given for the container. However, this adds in some helper functions as well, so that starting or restarting the container can be done just by calling the script, and updating the container is as easy as calling the script with "update" as the first argument.

# MediaGoblin docker container bootstrap
# References:
# - https://savannah.gnu.org/projects/mediagoblin
# - https://hub.docker.com/r/mtlynch/mediagoblin
### Setup
set -o errexit
set -o pipefail
# Docker stuff
# CONTAINER refers to the namespace and container name
# SHORTNAME can be changed to whatever you like
# CONTAINERTAG should be latest unless you have need of a specific tag
# Docker options
# The INSIDEPORT should remain the same; see the docker hub page
# The OUTSIDEPORT can be whatever you like (>1024) and must match nginx config
# The LOCALDIR is the directory on your local file system to mount inside the container
# The CONTAINERDIR should remain as-is; see the docker hub page.
### Functions
# Pull the latest container
function pullContainer() {
    docker pull "${CONTAINER}":"${CONTAINERTAG}"
# Check if the container is running
function checkRunning() {
    return $(docker ps | grep -c "${SHORTNAME}")
# Stop existing container
function stopContainer() {
    docker stop "${SHORTNAME}"
    docker rm "${SHORTNAME}"
# Run the container.
function runContainer() {
    docker run -d \
        --name "${SHORTNAME}" \
        --restart=unless-stopped \
        --publish ${OUTSIDEPORT}:${INSIDEPORT} \
        --volume ${LOCALDIR}:${CONTAINERDIR} \
### Logic
# Update if desired
if [[ "$1" == "update" ]]; then
# If it is running, stop it.
if ! checkRunning ; then
# Run the container



Warning: Out Of Date. Was at version 0.7.1 on 2016-12-20. Can you help to update it?

Source code for the MediaGoblin Sandstorm app:


Personal tools