{"id":13994751,"url":"https://github.com/JAremko/docker-emacs","last_synced_at":"2025-07-22T20:30:53.467Z","repository":{"id":44387372,"uuid":"72101536","full_name":"JAremko/docker-emacs","owner":"JAremko","description":"Dockerized Emacs (GUI)","archived":true,"fork":false,"pushed_at":"2022-04-10T20:45:00.000Z","size":79,"stargazers_count":257,"open_issues_count":3,"forks_count":42,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-07-14T08:09:04.421Z","etag":null,"topics":["cross-platform","docker","docker-image","editor","emacs","gui"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JAremko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-27T11:26:56.000Z","updated_at":"2025-05-15T11:27:30.000Z","dependencies_parsed_at":"2022-07-14T15:17:04.067Z","dependency_job_id":null,"html_url":"https://github.com/JAremko/docker-emacs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JAremko/docker-emacs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JAremko%2Fdocker-emacs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JAremko%2Fdocker-emacs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JAremko%2Fdocker-emacs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JAremko%2Fdocker-emacs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JAremko","download_url":"https://codeload.github.com/JAremko/docker-emacs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JAremko%2Fdocker-emacs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266567140,"owners_count":23949295,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cross-platform","docker","docker-image","editor","emacs","gui"],"created_at":"2024-08-09T14:03:05.161Z","updated_at":"2025-07-22T20:30:53.185Z","avatar_url":"https://github.com/JAremko.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"#### Dockerized Emacs with GUI(Mac, Windows, GNU/Linux and your browser)\n\n##### *Images are clickable*\n\n[![http://i.imgur.com/rONW3c3.jpg](http://i.imgur.com/B1gvpmK.jpg)](http://i.imgur.com/rONW3c3.jpg)\n[![http://i.imgur.com/mjl9ALQ.jpg](http://i.imgur.com/j6TO942.jpg)](http://i.imgur.com/mjl9ALQ.jpg)\n[![http://i.imgur.com/RB46TA9.jpg](http://i.imgur.com/PCpbVg0.jpg)](http://i.imgur.com/RB46TA9.jpg)\n\n[docker-x11-bridge](https://github.com/JAremko/docker-x11-bridge) + a web browser\n[![https://github.com/JAremko/docker-x11-bridge/raw/master/img/demoHD.jpg](https://github.com/JAremko/docker-x11-bridge/raw/master/img/demo.jpg)](https://github.com/JAremko/docker-x11-bridge/raw/master/img/demoHD.jpg)\n\n\n#### Why?\n  - Reap the benefits of Emacs and other GNU/Linux tools on Windows/MacOS machines\n  - Use [docker hub](https://hub.docker.com/) to auto-build your environment and store full backups for free\n  - Build once and work with the same development environment everywhere\n  - Run untrusted/risky code in the tunable sandbox with CPU/network/disk quotas\n  - Try new tools, experiment and roll back changes when something goes wrong\n  - Share your setup with others or extend someone else’s development environment\n  - Run multiple Emacs instances on the same machine isolated\n  - An easy way to swap Emacs version (`emacs26`,`emacs25`,`emacs-snapshot`) for debugging\n  - [Pause](https://docs.docker.com/engine/reference/commandline/pause) container to free resources temporarily\n  - [Checkpoint \u0026 Restore](https://github.com/docker/docker/blob/1.13.x/experimental/checkpoint-restore.md) - maybe the fastest way to start a “heavy” environment\n  - Friendly for networks with low upload speed/quotas\n\n#### Tags:\n - `latest`  [dockerfiles/emacs26](https://github.com/JAremko/docker-emacs/blob/master/Dockerfile.emacs26)\n - `emacs25`  [dockerfiles/emacs25](https://github.com/JAremko/docker-emacs/blob/master/Dockerfile.emacs25)\n - `testing` [dockerfiles/snapshot](https://github.com/JAremko/docker-emacs/blob/master/Dockerfile.snapshot)\n - `alpine` [dockerfiles/alpine](https://github.com/JAremko/docker-emacs/blob/master/Dockerfile.alpine) - *[Emacs build](https://pkgs.alpinelinux.org/package/edge/community/x86_64/emacs) on [Alpine Linux](https://www.alpinelinux.org/) small (around 300mb uncompressed) but can be glitchy*\n\n*If you need a different Emacs version/configuration checkout [Silex/docker-emacs](https://github.com/Silex/docker-emacs)*\n\n#### How to use\nFirst get [docker](https://docs.docker.com/engine/installation/) for your OS.\nThen you can use one of the images as a base([FROM](https://docs.docker.com/engine/reference/builder/#/from)) for your [Dockerfile](https://docs.docker.com/engine/reference/builder/).\n[Simple example](https://github.com/JAremko/docker-emacs-example), [Spacemacs distribution](https://github.com/syl20bnr/spacemacs/tree/develop/layers/%2Bdistributions/spacemacs-docker).\nIt will allow you to install and backup additional software/package dependencies. With [Dockerfile ADD](https://docs.docker.com/engine/reference/builder/#add) instruction\nyou can extract your `.emacs.d` from archives and remote repositories like GitHub using URL.\nAlso you can simply run one of the images:\n\n##### MacOS:\nGet [`XQuartz`](https://www.xquartz.org)\n\n```\nopen -a XQuartz\n```\nIn the XQuartz preferences, go to the “Security” tab and make sure you’ve got “Allow connections from network clients” ticked\n```\nip=$(ifconfig en0 | grep inet | awk '$1==\"inet\" {print $2}')\nxhost + $ip\ndocker run -ti --name emacs\\\n -e DISPLAY=$ip:0\\\n -e UNAME=\"emacser\"\\\n -e GNAME=\"emacsers\"\\\n -e UID=\"1000\"\\\n -e GID=\"1000\"\\\n -v \u003cpath_to_your_.emacs.d\u003e:/home/emacs/.emacs.d\\\n -v \u003cpath_to_your_workspace\u003e:/mnt/workspace\\\n jare/emacs emacs\n```\n*[source](https://fredrikaverpil.github.io/2016/07/31/docker-for-mac-and-gui-applications/)*\n\n*[other method](https://github.com/chanezon/docker-tips/blob/master/x11/README.md)*\n\n##### Windows\nGet [Cygwin](https://www.cygwin.com/) with `xinit`, `xorg-server` and optionaly [`winpty`](https://github.com/rprichard/winpty)(to run Emacs container with `-t`)\n```\nexport DISPLAY=\u003cyour-machine-ip\u003e:0.0\nstartxwin -- -listen tcp \u0026\nxhost + \u003cyour-machine-ip\u003e\n```\n\n```\ndocker run --name emacs\\\n -e DISPLAY=\"$DISPLAY\"\\\n -e UNAME=\"emacser\"\\\n -e GNAME=\"emacsers\"\\\n -e UID=\"1000\"\\\n -e GID=\"1000\"\\\n -v \u003cpath_to_your_.emacs.d\u003e:/home/emacs/.emacs.d\\\n -v \u003cpath_to_your_workspace\u003e:/mnt/workspace\\\n jare/emacs emacs\n ```\n Or with `-ti` via `winpty`\n ```\nwinpty docker run -ti --name emacs\\\n -e DISPLAY=\"$DISPLAY\"\\\n -e UNAME=\"emacser\"\\\n -e GNAME=\"emacsers\"\\\n -e UID=\"1000\"\\\n -e GID=\"1000\"\\\n -v \u003cpath_to_your_.emacs.d\u003e:/home/emacs/.emacs.d\\\n -v \u003cpath_to_your_workspace\u003e:/mnt/workspace\\\n jare/emacs emacs\n ```\n*[source](http://manomarks.github.io/2015/12/03/docker-gui-windows.html)*\n*You can use [@ninrod 's setup](https://www.reddit.com/r/emacs/comments/7a63r4/emacs_in_win10linuxdockerxserver_combo/)*\n\n##### GNU/Linux\n*`UID` and preferably `UNAME` should match the host's user id.\nAlso make sure that `$DISPLAY` variable is set*\n```\ndocker run -ti --name emacs -v /tmp/.X11-unix:/tmp/.X11-unix:ro\\\n -e DISPLAY=\"unix$DISPLAY\"\\\n -e UNAME=\"emacser\"\\\n -e GNAME=\"emacsers\"\\\n -e UID=\"1000\"\\\n -e GID=\"1000\"\\\n -v \u003cpath_to_your_.emacs.d\u003e:/home/emacs/.emacs.d\\\n -v \u003cpath_to_your_workspace\u003e:/mnt/workspace\\\n jare/emacs emacs\n```\nThat's it! Now you should see Emacs window.\n\n###### If it doesn't work\n\nYou may need to allow local connection for the user\n`UNAME` should match the hosts user id.\n```\nxhost +si:localuser:\u003cUNAME\u003e\n```\nOr allow local connection from the container's hostname(This should work with any `UID`)\n```\nxhost +local:`docker inspect --format='{{ .Config.Hostname }}' emacs`\n```\n*[source](http://stackoverflow.com/questions/25281992/alternatives-to-ssh-x11-forwarding-for-docker-containers)*\n\n##### Also you can run it with [docker-x11-bridge](https://github.com/JAremko/docker-x11-bridge)\n###### Pros:\n  - Same client for GNU/Linux, Windows and MacOS + web browser\n  - Persistent server (you can connect and disconnect without disrupting Emacs)\n  - Interactive screen sharing [demo](https://imgur.com/ijdSuX6)\n  - Use Emacs in web-browser (O_O) [demo](https://imgur.com/wDLDMZN)\n\n###### Cons:\n  - Lag spikes with some OSes\n\n##### Basic docker commands to get you started:\n  - `docker rm -f emacs` - remove `emacs` container\n  - `docker restart emacs` - restart `emacs` container\n  - `docker rmi -f jare/emacs` - remove `jare/emacs` image\n  - `docker pull jare/emacs` - get newer `jare/emacs` version\n  - `docker images -a` - list all images\n  - `docker ps -a` - list all containers\n  - `docker run ... jare/emacs` - run the [default command](https://github.com/JAremko/docker-emacs/blob/master/Dockerfile#L45)\n  - `docker run -ti ... jare/emacs /bin/bash` - start bash\n  - `docker exec emacs /usr/bin/emacs` - start `/usr/bin/emacs` in the running `emacs` container\n  - `docker logs emacs` - print `emacs` container's logs\n  - `docker run ... -p 8080:8080 ... jare/emacs` - access container's server from localhost:8080\n  - `docker cp \u003cfrom_my_local_machine_path\u003e emacs:/\u003cto_my_emacs_container_path\u003e`\n  - `docker cp emacs:/\u003cfrom_my_emacs_container_path\u003e \u003cto_my_local_machine_path\u003e`\n  -  Manage data in containers with [Docker volumes](https://docs.docker.com/engine/tutorials/dockervolumes/). Example:\n    -  `docker volume create --name my-workspace`\n    -  `docker run ... -v my-workspace:/mnt/workspace ... jare/emacs`\n    -  `docker run ... -v my-workspace:/home/developer/workspace ... jare/vim-bundle`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJAremko%2Fdocker-emacs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJAremko%2Fdocker-emacs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJAremko%2Fdocker-emacs/lists"}