{"id":20456682,"url":"https://github.com/jgoerzen/docker-mythtv","last_synced_at":"2026-05-06T19:37:01.617Z","repository":{"id":66276360,"uuid":"94021220","full_name":"jgoerzen/docker-mythtv","owner":"jgoerzen","description":"[read-only mirror] MythTV server in Docker","archived":false,"fork":false,"pushed_at":"2023-11-10T13:17:26.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-15T23:39:56.082Z","etag":null,"topics":["docker","docker-image","mythtv"],"latest_commit_sha":null,"homepage":"https://salsa.debian.org/jgoerzen/docker-mythtv","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jgoerzen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-11T17:39:22.000Z","updated_at":"2022-02-08T19:29:11.000Z","dependencies_parsed_at":"2023-11-10T14:27:57.033Z","dependency_job_id":"d2520c7b-def6-4f53-aa77-528433572c06","html_url":"https://github.com/jgoerzen/docker-mythtv","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgoerzen%2Fdocker-mythtv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgoerzen%2Fdocker-mythtv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgoerzen%2Fdocker-mythtv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgoerzen%2Fdocker-mythtv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgoerzen","download_url":"https://codeload.github.com/jgoerzen/docker-mythtv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242008645,"owners_count":20056930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-image","mythtv"],"created_at":"2024-11-15T11:23:37.056Z","updated_at":"2026-05-06T19:37:01.566Z","avatar_url":"https://github.com/jgoerzen.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker MythTV Images\n\n**This repository is no longer hosted at Github; see its [new homepage on Salsa](https://salsa.debian.org/jgoerzen/docker-mythtv).**\n\nThis is a set of images that makes it simple to set up a basic\nheadless server for [MythTV](http://www.mythtv.org).  These images\nrun on top\nof my [Debian base system](http://salsa.debian.org/jgoerzen/docker-debian-base),\nwhich provides excellent logging capabilities.  This image is part of the\n[docker-mythtv](https://salsa.debian.org/jgoerzen/docker-mythtv) image set.\n\nMythTV is a large and complex piece of software, and will require customization.\nSome people use the MythTV backend to talk to local PCI or USB TV framegrabber/tuner\ndevices.  Such use, if it is even possible under Docker, is out of scope of\nthis document.  However, many TV tuners are now network-accessible, and thus\nmay be used over a local LAN with a Docker container without incident.\n\nThese images, therefore, handle the installation of MythTV for you.  You will\nbe responsible for the configuration to your own situation.  Please familiarize\nyourself with the information on the MythTV website before proceeding.\n\nYou can view the [documentation for these images](https://salsa.debian.org/jgoerzen/docker-mythtv)\non their Github page.\n\nThese images are provided:\n\n - [jgoerzen/mythtv-backend](https://salsa.debian.org/jgoerzen/docker-mythtv-backend) - the MythTV backend server processes\n - [jgoerzen/mythtv-backend-mysql](https://salsa.debian.org/jgoerzen/docker-mythtv-backend-mysql) - as mythtv-backend, but with an integrated MySQL/MariaDB server in\n   the container\n\nIf you do not already have a database server on your network, selecting the\nmysql variant will simplify your installation, though it is optional.\n\nYou can download with:\n\n    docker pull jgoerzen/mythtv-backend-mysql\n\nAnd run with something like this:\n\n    docker run -td -p 6554:6554 -p 6543:6543 -p 6544:6544 -p 6549:6549 -p 5901:5901 \\\n    --stop-signal=SIGPWR \\\n    --hostname=mythtv-backend \\\n    -v /musicdir:/music:ro \\\n    -v /playlistdir:/playlists:rw \\\n    --name=mythtv jgoerzen/mythtv-backend-mysql\n\nOn a newer host, like Debian bullseye, use this instead:\n\n    docker run -td -p 6554:6554 -p 6543:6543 -p 6544:6544 -p 6549:6549 -p 5901:5901 \\\n    --stop-signal=SIGRTMIN+3 \\\n    --tmpfs /run:size=100M --tmpfs /run/lock:size=100M \\\n    --hostname=mythtv-backend \\\n    -v /musicdir:/music:ro \\\n    -v /playlistdir:/playlists:rw \\\n    -v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host \\\n    --name=mythtv jgoerzen/mythtv-backend-mysql\n\n(Omit the `-mysql` from both commands if you have a MySQL server elsewhere that you\nwill connect to.)\n\nNote: it is **critical** that the hostname be specified.  MythTV uses the\nhostname as a key into its settings database, and Docker's randomly-assigned\nhostnames will cause issues in this scenario.  See\n[more about hostnames on the MythTV site](https://www.mythtv.org/wiki/Database_Backup_and_Restore#Change_the_hostname_of_a_MythTV_frontend_or_backend).\n\n# Initial Setup Background\n\nAlthough the MythTV backend is able to be run as a headless server, it\nnevertheless requires setup to be done via a graphical program.  This\nposes a bit of an annoyance for the normally all-text Docker environment.\n\nI have, however, provided you with two options for accessing it.\n\nOption 1 is to use VNC.  If Docker is running on localhost, or a host you\ncan ssh to with port forwarding, it will expose VNC screen 1 on port 5901.\nYou can connect to this with a VNC viewer and control it that way.\n\nOption 2 is to use SSH with X11 forwarding.  This is a more advanced\noption that is largely outside the scope of this document.  The basic steps\nare to add `-e DEBBASE_SSH=enabled` to your `docker run` command, forward\nport 23 into the container, provision a password for a user inside the container\nwith `passwd` or similar, and then use `ssh -X` to connect to it.\n\nPlease note that SSH is an encrypted protocol, but VNC generally is not;\nit is not secure to expose the VNC port over the Internet.\n\nEither way, you will need to know how to get a shell prompt within your\ncontainer.  If you, for instance, named it mythtv-backend, then\n`docker exec -ti mythtv-backend bash` will do the trick.\n\nAs we go along, I will try to make it clear what steps you can do with\nyour own Dockerfile (which will be most of them).\n\n## jgoerzen/mythtv-backend (non-mysql) only: Prepare database\n\nThe `mythtv-database` package generally wants to be installed on the database server itself.\nYou may have some trickery to do here.\n\nFirst, let's assign a username and password.  Run:\n\n    dpkg-reconfigure -plow mythtv-common\n\nNext, if you do not already have a MythTV database,\ninstall the package that configures or sets up the MythTV database.\nBecause it requires a database to be present to install, it is only provided by\ndefault in the mythtv-backend-mysql package.  This package will configure your database to an\nexisting server.  Open a shell in the container and run:\n\n    apt-get update\n    rm /etc/apt/apt.conf.d/docker-clean\n    apt-get install --no-install-recommends mythtv-database\n\nIt will ask for a password for the administrator account.\nIt will then create the needed database.  Please note that this only needs\nto be done once; you do not need this package installed in your\nongoing containers.\n\n## All setups: configure the backend\n\nNow you're ready to configure the backend.  Fire up the VNC server with:\n\n    su - mythtv -c startvnc\n    su - mythtv -c \"DISPLAY=:1 xterm\"\n\nThe first time you run `startvnc`, it will prompt you to enter a password.\nMake up something secure.\n\nOn your workstation, a command like this should connect you to the GUI:\n\n   xvnc4viewer localhost:1\n\nEnter the same password you set before.\n\nIn the GUI that appears, run:\n\n   mythtv-setup\n\nOn the general settings page, the IP address of the backend should be set to\nthe interal IP address (more on that below).\n\nWhen you are all done, stop the VNC server with:\n\n    su - mythtv -c 'tigervncserver -kill :1'\n\n# Hints for your own Dockerfiles\n\nHere are some files you may want to install:\n\n - ~mythtv/.mythtv/config.xml (/var/lib/mythtv)\n - /etc/mythtv/config.xml\n\nYou could prime the Debconf database with the MythTV passwords with:\n\n    echo 'mythtv-common mythtv/mysql_mythtv_password password foo' | debconf-set-selections\n    echo 'mythtv-common mythtv/mysql_mythtv_user string mythtv' | debconf-set-selections\n    echo 'mythtv-common mythtv/mysql_mythtv_dbname string mythconverg' | debconf-set-selections\n    echo 'mythtv-common mythtv/mysql_host string localhost' | debconf-set-selections\n\n# IP address notes\n\nSo this is pretty annoying.  MythTV insists on storing the IP\naddress as seen by the backend in its database, and other\nmachines use that IP to reach it.  With docker, there is generally\nno way tihs works because of NAT.\n\nAlso, if you use a capture device like the HDHomeRun which communicates\nback to MythTV via random UDP ports, it can be just about impossible to\nmake things work with the standard docker port forwarding.\n\nHowever, there are some workarounds.\n\nYou can:\n\n - Use NAT reflection on your firewall to forward packets\n   back in to your network.\n - [Bridge your Docker containers to the network](https://developer.ibm.com/recipes/tutorials/bridge-the-docker-containers-to-external-network/)\n   - An example: `docker network create --driver=bridge --ip-range=192.168.0.192/29 --subnet=192.168.0.0/24 --aux-address \"DefaultGatewayIPv4=192.168.0.1\" -o \"com.docker.network.bridge.name=brlan1\" brlan1`\n   - After that, you can add `network=brlan1 --ip=192.168.0.193` do your `docker run`, and you do not need\n     any `-p` because it will be directly accessible on the new IP.\n - Add egress iptables rules to your frontends\n - You can set the BackendServerIP and MasterServerIP to the \"visible\" IP\n   of the backend (will probably have to do this via mysql).  mythbackend\n   will fail to bind to a visible IP, but a userland redirector like `redir`\n   may do the trick.\n\nI tried adding `-O BackendServerIP=blah -O MasterServerIP=blah` to my\nmythfrontend command line.  That let it boot, but wasn't sufficient for\nstreaming.\n\n# Bugs\n\nmythbackend doesn't seem to properly write its PID to /var/run/mythtv, and\ntherefore commands that try to kill it won't work.\n\n# Source\n\nThis is prepared by John Goerzen \u003cjgoerzen@complete.org\u003e and the source\ncan be found at https://salsa.debian.org/jgoerzen/docker-mythtv\n\n# Security Status\n\nThe Debian operating system is configured to automatically apply security patches.\nMythTV, however, does not have such a feature.\n\n# Tags\n\nBecause this is built from the deb-multimedia.org sources, I cannot easily\nprovide historical builds, since deb-multimedia itself does not.  Threfore,\nonly current deb-multimedia.org builds are available.\n\n# Copyright\n\nDocker scripts, etc. are\nCopyright (c) 2017-2022 John Goerzen\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n1. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n3. Neither the name of the University nor the names of its contributors\n   may be used to endorse or promote products derived from this software\n   without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\nOR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\nOUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGE.\n\nAdditional software copyrights as noted.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgoerzen%2Fdocker-mythtv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgoerzen%2Fdocker-mythtv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgoerzen%2Fdocker-mythtv/lists"}