NOW works with Minecraft 1.20
This is a major change in logic to build the correct version of spigot so some combination of conditions may not compile correctly. Please make an issue so I can correct it. There will be another build shortly with another feature
Java bug on version 1.17 with 1 core add -e OTHER_JAVA_OPTS=-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 as workaround
This docker image builds and runs the spigot version of minecraft.
If the spigot.jar is not found in the minecraft directory the system pulls down BuildTool and builds a new spigot.jar from the latest released minecraft.jar
Each time the container is started the presence of the file /minecraft/spigot.jar, if the file is missing a build of spigot.jar is started.
The spigot daemon is started with supervisord, see my Ubuntu container for a more detailed description of my implementation of an init-process in ubuntu, see nimmis/ubuntu
What's new is
Due to legal reasons you can build it yourself but you can't redistribute the finished jar file.
To run the latest stable version of this docker image run
docker run -d -p 25565:25565 -e EULA=true nimmis/spigot
the parameter
-e EULA=true
The is because Mojang now requires the end user to access their EULA, located at https://account.mojang.com/documents/minecraft_eula, the be able to start the server.
the parameter
-p 25565:25565
specifies on which external port the internal 25565 should be connected, in this case the same. If you only type -p 25565 it will connect to a random port on the machine.
To make it easier to handle you container you can give it a name instead of the long number that's normally given to it, add a
--name spigot
to the run command to give it the name minecraft, then you can start it easier with
docker start spigot
docker stop spigot
This will take a couple of minutes depending on computer and network speed. It will pull down the selected version on BuildTools and build a spigot.jar from the selected minecraft version. This is done in numerous steps so be patient.
You can follow the output from the compilation with this command (assuming that you gave the container the name spigot)
docker logs -f spigot
*** open logfile
*** Run files in /etc/my_runonce/
*** Running /etc/my_runonce/00_dump_info.sh...
Build of nimmis/spigot:latest, date: 2021-12-06T12:54:26Z
Build of nimmis/ubuntu:20.04, date: 2021-07-04T09:06:36Z
*** Running /etc/my_runonce/50_set_timezone...
timezone not set, trying to autodetect
external ip is 95.192.***.***
timezone should be Europe/Stockholm
setting timezone to Europe/Stockholm
*** Running /etc/my_runonce/90_autorestart...
*** Run files in /etc/my_runalways/
*** Running /etc/my_runalways/00_minecraft_owner...
missmatch between directory owner and minecraft user
Changed owner of minecraft to UID 0
*** Running /etc/my_runalways/10_set_mc_version...
*** Running /etc/my_runalways/50_do_build_spigot...
checking 1.18
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 135k 100 135k 0 0 436k 0 --:--:-- --:--:-- --:--:-- 434k
Setting version to 1.18
set java version to 17
Building spigot version (1.18) jar file, be patient
Once the compilation completes the server will start and you will see something like
Success! Everything completed successfully. Copying final .jar files now.
Copying spigot-1.18-R0.1-SNAPSHOT-bootstrap.jar to /build-mc/./spigot-1.18.jar
Saved as ./spigot-1.18.jar
Successfull build of spigot version 1.18
Setting 1.18 as current spigot version
*** Running /etc/my_runalways/85_fix_startsh...
start.sh missing, creating link for /minecraft/start.sh
*** Running /etc/my_runalways/90_eula...
*** Booting supervisor daemon...
*** Supervisor started as PID 781
*** Started processes via Supervisor......
crond RUNNING pid 783, uptime 0:00:04
spigot RUNNING pid 784, uptime 0:00:04
syslog-ng RUNNING pid 785, uptime 0:00:03
you can then exit from the log with CTRL-C
You can now change the minecraft version after you started the container the first time.
If you don't specify this parameter it will check the minecraft directory in the container to see if there is a previous compiled version linked. If so the container will use that version.
If no version of spigot is linked (like first time) it will always compile the latest version but if you want a specific version you can specify it by adding
-e SPIGOT_VER=<version>
where <version> is the version you would like to use, to build it with version 1.18 add
-e SPIGOT_VER=1.18
to the docker run line.
There is a command to change minecraft version in a running container
docker exec -it spigot set_mc_ver <version>
when the command is executed it will check if there is a compiled version already in the minecraft folder, if not it will build it.
It first stops the running minecraft, changes java version if needed (download if missing), compiles a new spigot if needed and then starts minecraft again.
It is not recommended to downgrade version as the world-information is not backwards compatible.
Please check the web page for BuildTools to get the latest information.
There are two environment variables to set maximum and initial memory for spigot.
Sets the maximum memory to use <size>m for MB or <size>g for GB, defaulting to 1 GB. To set the maximum memory to 2 GB add this environment variable
-e MC_MAXMEM=2g
Sets the initial memory reservation used, use <size>m for MB or <size>g for GB, if this parameter is not set, it is set to MC_MAXMEM. To set the initial size to 512 MB
-e MC_MINMEM=512m
This variable controls the behavior of the container when the stop command is issued inside minecraft
-e SPIGOT_AUTORESTART=yes
Which is the default behavior and does not need to be specified, the minecraft server will autostart if the stop command is issued.
-e SPIGOT_AUTORESTART=no
If the stop command is issued the minecraft server will stay down until the container is restarted or the command mc_start is issued
Allows adding other Java options when starting minecraft
-e OTHER_JAVA_OPS=
To get an output of the latest events from the spigot server type
docker exec spigot mc_log
and you will see the last 10 lines from the output, this is what you will see after startup
Abort with CTRL-C
[13:02:15 INFO]: Zombie Aggressive Towards Villager: true
[13:02:15 INFO]: Experience Merge Radius: 3.0
[13:02:15 INFO]: Preparing start region for level 0 (Seed: 506255305130990210)
[13:02:16 INFO]: Preparing spawn area: 22%
[13:02:17 INFO]: Preparing spawn area: 99%
[13:02:17 INFO]: Preparing start region for level 1 (Seed: 506255305130990210)
[13:02:18 INFO]: Preparing spawn area: 95%
[13:02:18 INFO]: Preparing start region for level 2 (Seed: 506255305130990210)
[13:02:18 INFO]: Server permissions file permissions.yml is empty, ignoring it
[13:02:18 INFO]: Done (3.650s)! For help, type "help" or "?"
It will continue to output everything from the console until you press CTRL-C
You don't need to have an interactive container to be able to send commands to the console. To send a command to set the time to day you type
docker exec spigot mc_send "time set day"
If this was the first command issued after a start the output should look like
[13:02:15 INFO]: Zombie Aggressive Towards Villager: true
[13:02:15 INFO]: Experience Merge Radius: 3.0
[13:02:15 INFO]: Preparing start region for level 0 (Seed: 506255305130990210)
[13:02:16 INFO]: Preparing spawn area: 22%
[13:02:17 INFO]: Preparing spawn area: 99%
[13:02:17 INFO]: Preparing start region for level 1 (Seed: 506255305130990210)
[13:02:18 INFO]: Preparing spawn area: 95%
[13:02:18 INFO]: Preparing start region for level 2 (Seed: 506255305130990210)
[13:02:18 INFO]: Server permissions file permissions.yml is empty, ignoring it
[13:02:18 INFO]: Done (3.650s)! For help, type "help" or "?"
[13:12:35 INFO]: Set the time to 1000
It will continue to output everything from the console until you press CTRL-C
To make yourself operator in the game use mc_send command, for example give the user myuser op use the command.
docker exec spigot mc_send op myuser
By default the minecraft server will automatically restart on a stop inside the minecraft application. You can override this behavior by using
-e SPIGOT_AUTORESTART=no
This will prevent the server automatically restarting and minecraft has to be started again with the mc_start command
To stop the server but not the container do
docker exec spigot mc_stop
To start it after being stopped do
docker exec spigot mc_start
Finally to restart it do
docker exec spigot mc_restart
When the container is stopped with the command
docker stop spigot
the spigot server is shutdown nicely with a console stop command to give it time to save everything before stopping the container. If you look in the output from the server you will see something like
[13:01:51 INFO]: Stopping the server
[13:01:51 INFO]: Stopping server
[13:01:51 INFO]: Saving players
[13:01:51 INFO]: nimmis lost connection: Server closed
[13:01:51 INFO]: nimmis left the game.
[13:01:51 INFO]: Saving worlds
[13:01:51 INFO]: Saving chunks for level 'world'/Overworld
[13:01:51 INFO]: Saving chunks for level 'world_nether'/Nether
[13:01:51 INFO]: Saving chunks for level 'world_the_end'/The End
If you delete the container all your files in minecraft will be gone. To save them where it's easier to edit and do a backup of the files you can attach a directory from the host machine (where you run the docker command) and attach it to the local file system in the container. The syntax for it is
-v /host/path/to/dir:/container/path/to/dir
To attach the minecraft directory in the container to directory /home/nimmis/mc-srv you add
-v /home/nimmis/mc-srv:/minecraft
When a external volume is mounted the UID of the owner of the volume may not match the UID of the minecraft user (1000). This can result in problems with write/read access to the files.
To address this problem a check is done between UID of the owner of /minecraft and the UID of the user minecraft. If there is a mismatch the UID of the minecraft user is changed to match the UID of the directory.
If you don't want to do this and want to manually set the UID of the minecraft user there is a variable named SPIGOT_UID which defines the minecraft user UID, adding
-e SPIGOT_UID=1132
sets the minecraft user UID to 1132.
The syntax is
docker exec -ti <spigot container name> <command> <paramaters>
If you get minecraft version not found and it is a version released after to started the container the first time. You need to update the list of available versions, do
docker exec -it <spigotverson> get_mc_versions
and you should get an output simular to
docker exec -it spigot get_mc_versions
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 135k 100 135k 0 0 498k 0 --:--:-- --:--:-- --:--:-- 498k
and the versionlist is updated.
If you have any problems with or questions about this image, please contact us by submitting a ticket through a GitHub issue
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.


全球首个AI音乐社区
音述AI是全球首个AI音乐社区,致力让每个人都能用音乐表达自我。音述AI提供零门槛AI创作工具,独创GETI法则帮助用户精准定义音乐风格,AI润色功能支持自动优化作品质感。音述AI支持交流讨论、二次创作与价值变现。针对中文用户的语言习惯与文化背景进行专门优化,支持国风融合、C-pop等本土音乐标签,让技术更好地承载人文表达。


阿里Qoder团队推出的桌面端AI智能体
QoderWork 是阿里推出的本地优先桌面 AI 智能体,适配 macOS14+/Windows10+,以自然语言交互实现文件管理、数据分析、AI 视觉生成、浏览器自动化等办公任务,自主拆解执行复杂工作流,数据本地运行零上传,技能市场可无限扩展,是高效的 Agentic 生产力办公助手。


一站式搞定所有学习需求
不再被海量信息淹没,开始真正理解知识。Lynote 可摘要 YouTube 视频、PDF、文章等内容。即时创建笔记,检测 AI 内容并下载资料,将您的学习效率提升 10 倍。


为AI短剧协作而生
专为AI短剧协作而生的AniShort正式发布,深度重构AI短剧全流程生产模式,整合创意策划、制作执行、实时协作、在线审片、资产复用等全链路功能,独创无限画布、双轨并行工业化工作流与Ani智能体助手,集成多款主流AI大模型,破解素材零散、版本混乱、沟通低效等行业痛点,助力3人团队效率提升800%,打造标准化、可追溯的AI短剧量产体系,是AI短剧团队协同创作、提升制作效率的核心工具。


能听懂你表达的视频模型
Seedance two是基于seedance2.0的中国大模型,支持图像、视频、音频、文本四种模态输入,表达方式更丰富,生成也更可控。


国内直接访问,限时3折
输入简单文字,生成想要的图片,纳米香蕉中文站基于 Google 模型的 AI 图片生成网站,支持文字生图、图生图。官网价格限时3折活动


职场AI,就用扣子
AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!


多风格AI绘画神器
堆友平台由阿里巴巴设计团队创建,作为一款AI驱动的设计工具,专为设计师提供一站式增长服务。功能覆盖海量3D素材、AI绘画、实时渲染以及专业抠图,显著提升设计品质和效率。平台不仅提供工具,还是一个促进创意交流和个人发展的空间,界面友好,适合所有级别的设计师和创意工作者。


零代码AI应用开发平台
零代码AI应用开发平台,用户只需一句话简单描述需求,AI能自动生成小程序、APP或H5网页应用,无需编写代码。


免费创建高清无水印Sora视频
Vora是一个免费创建高清无水印Sora视频的AI工具
最新AI工具、AI资讯
独家AI资源、AI项目落地

微信扫一扫关注公众号