mirror of
https://github.com/pterodactyl/documentation.git
synced 2025-12-10 10:44:43 -06:00
133 lines
36 KiB
HTML
133 lines
36 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-US">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>Creating a Custom Egg | Pterodactyl</title>
|
|
<meta name="generator" content="VuePress 1.8.2">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
|
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
|
|
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
|
|
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#0e4688">
|
|
<link rel="manifest" href="/favicons/site.webmanifest">
|
|
<link rel="shortcut icon" href="/favicons/favicon.ico">
|
|
<meta name="description" content="Pterodactyl is an open-source game server management panel built with PHP 7, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.">
|
|
<meta name="msapplication-config" content="/favicons/browserconfig.xml">
|
|
<meta name="theme-color" content="#0e4688">
|
|
|
|
<link rel="preload" href="/assets/css/0.styles.b3d0dfa6.css" as="style"><link rel="preload" href="/assets/js/app.6ca2c4a6.js" as="script"><link rel="preload" href="/assets/js/4.babf7215.js" as="script"><link rel="preload" href="/assets/js/1.79a56ae5.js" as="script"><link rel="preload" href="/assets/js/12.2e01246c.js" as="script"><link rel="prefetch" href="/assets/js/10.27cec751.js"><link rel="prefetch" href="/assets/js/11.27ba30b0.js"><link rel="prefetch" href="/assets/js/13.bd04c4ec.js"><link rel="prefetch" href="/assets/js/14.f2be742e.js"><link rel="prefetch" href="/assets/js/15.a6802091.js"><link rel="prefetch" href="/assets/js/16.f2dea920.js"><link rel="prefetch" href="/assets/js/17.e3b378b0.js"><link rel="prefetch" href="/assets/js/18.fcb158a9.js"><link rel="prefetch" href="/assets/js/19.f0fdb6e9.js"><link rel="prefetch" href="/assets/js/2.21e1a937.js"><link rel="prefetch" href="/assets/js/20.a31cd600.js"><link rel="prefetch" href="/assets/js/21.986dab58.js"><link rel="prefetch" href="/assets/js/22.01e99816.js"><link rel="prefetch" href="/assets/js/23.ab477db3.js"><link rel="prefetch" href="/assets/js/24.3db401dc.js"><link rel="prefetch" href="/assets/js/25.fb19183c.js"><link rel="prefetch" href="/assets/js/26.199e42e5.js"><link rel="prefetch" href="/assets/js/27.53b2955f.js"><link rel="prefetch" href="/assets/js/28.b1cca863.js"><link rel="prefetch" href="/assets/js/29.c234f3e0.js"><link rel="prefetch" href="/assets/js/30.61a90133.js"><link rel="prefetch" href="/assets/js/31.6cbb938e.js"><link rel="prefetch" href="/assets/js/32.7effab83.js"><link rel="prefetch" href="/assets/js/33.5cb72a20.js"><link rel="prefetch" href="/assets/js/34.f044669f.js"><link rel="prefetch" href="/assets/js/35.cf289140.js"><link rel="prefetch" href="/assets/js/36.a7402f3b.js"><link rel="prefetch" href="/assets/js/37.b81f7a4e.js"><link rel="prefetch" href="/assets/js/38.e385c788.js"><link rel="prefetch" href="/assets/js/39.a7036ff5.js"><link rel="prefetch" href="/assets/js/40.5561e292.js"><link rel="prefetch" href="/assets/js/41.8357cc2d.js"><link rel="prefetch" href="/assets/js/42.ed9e1c27.js"><link rel="prefetch" href="/assets/js/43.9fd714d5.js"><link rel="prefetch" href="/assets/js/44.5250ac95.js"><link rel="prefetch" href="/assets/js/45.3ebbab0e.js"><link rel="prefetch" href="/assets/js/46.a3168226.js"><link rel="prefetch" href="/assets/js/47.7a0c0c49.js"><link rel="prefetch" href="/assets/js/48.8b4df094.js"><link rel="prefetch" href="/assets/js/49.1e699f40.js"><link rel="prefetch" href="/assets/js/5.407df260.js"><link rel="prefetch" href="/assets/js/50.fb545b0b.js"><link rel="prefetch" href="/assets/js/51.8bf819d3.js"><link rel="prefetch" href="/assets/js/52.c0fa38e2.js"><link rel="prefetch" href="/assets/js/53.acaa8c4b.js"><link rel="prefetch" href="/assets/js/54.01f718b6.js"><link rel="prefetch" href="/assets/js/55.0c83194a.js"><link rel="prefetch" href="/assets/js/56.488f03fe.js"><link rel="prefetch" href="/assets/js/57.6cdf7d48.js"><link rel="prefetch" href="/assets/js/58.139108d1.js"><link rel="prefetch" href="/assets/js/59.2de63e9e.js"><link rel="prefetch" href="/assets/js/6.8999fd8a.js"><link rel="prefetch" href="/assets/js/60.a35a1994.js"><link rel="prefetch" href="/assets/js/61.c644eb6e.js"><link rel="prefetch" href="/assets/js/62.6d624b0b.js"><link rel="prefetch" href="/assets/js/63.08f06847.js"><link rel="prefetch" href="/assets/js/64.8d69a757.js"><link rel="prefetch" href="/assets/js/65.81003f00.js"><link rel="prefetch" href="/assets/js/66.2ff8637d.js"><link rel="prefetch" href="/assets/js/67.c7e98a1e.js"><link rel="prefetch" href="/assets/js/68.e7498700.js"><link rel="prefetch" href="/assets/js/69.bb730956.js"><link rel="prefetch" href="/assets/js/7.9f1ce256.js"><link rel="prefetch" href="/assets/js/70.51c1e550.js"><link rel="prefetch" href="/assets/js/71.91217b54.js"><link rel="prefetch" href="/assets/js/72.7f5dd9c7.js"><link rel="prefetch" href="/assets/js/73.3c0e5aad.js"><link rel="prefetch" href="/assets/js/74.1351a3ef.js"><link rel="prefetch" href="/assets/js/75.6351ca99.js"><link rel="prefetch" href="/assets/js/76.0b5f8895.js"><link rel="prefetch" href="/assets/js/77.54ccbb7a.js"><link rel="prefetch" href="/assets/js/78.8283cd45.js"><link rel="prefetch" href="/assets/js/8.f62ead52.js"><link rel="prefetch" href="/assets/js/9.7af626f7.js">
|
|
<link rel="stylesheet" href="/assets/css/0.styles.b3d0dfa6.css">
|
|
</head>
|
|
<body>
|
|
<div id="app" data-server-rendered="true"><div><div class="fixed h-12 w-full z-50 top-0"><div class="h-12 w-full bg-black flex items-center justify-center px-4"><p class="text-grey-lightest font-semibold">
|
|
Stand with Ukraine 🇺🇦
|
|
<a href="https://www.savethechildren.org/us/where-we-work/ukraine" target="_blank" rel="noindex nofollow noopener" class="text-blue-lighter">Donate</a> <a href="https://razomforukraine.org/" target="_blank" rel="noindex nofollow noopener" class="text-blue-lighter">Today.</a></p></div></div> <div class="theme-container mt-12"><header class="nav"><div class="sidebar-button block md:hidden flex-no-shrink"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <div class="logo-container"><a href="/" class="home-link router-link-active"><img src="/logos/pterry.svg" class="logo"> <span class="site-name hidden md:inline can-hide">Pterodactyl</span></a></div> <div class="w-full"><div class="flex"><div class="search-box"><input aria-label="Search" placeholder="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links flex-no-shrink hidden md:flex"><div class="nav-item"><a href="/project/introduction.html" class="nav-link">Documentation
|
|
</a></div><div class="nav-item"><a href="/community/about.html" class="nav-link">Community Guides
|
|
</a></div><div class="nav-item"><a href="https://discord.gg/pterodactyl" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
|
Get Help
|
|
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://dashflo.net/docs/api/pterodactyl/v1/" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
|
API
|
|
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <div class="nav-item"><a href="https://github.com/pterodactyl/panel" target="_blank" rel="noopener noreferrer" class="nav-link">
|
|
GitHub
|
|
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div></nav></div></div></header> <div class="sidebar-mask"></div> <div class="sidebar"><nav class="nav-links flex-no-shrink block md:hidden"><div class="nav-item"><a href="/project/introduction.html" class="nav-link">Documentation
|
|
</a></div><div class="nav-item"><a href="/community/about.html" class="nav-link">Community Guides
|
|
</a></div><div class="nav-item"><a href="https://discord.gg/pterodactyl" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
|
Get Help
|
|
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://dashflo.net/docs/api/pterodactyl/v1/" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
|
API
|
|
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <div class="nav-item"><a href="https://github.com/pterodactyl/panel" target="_blank" rel="noopener noreferrer" class="nav-link">
|
|
GitHub
|
|
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div></nav> <ul class="sidebar-links"><li><div class="sidebar-group first"><p class="sidebar-heading"><span>Community Guides</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/about.html" class="sidebar-link">Community Guides and Tutorials</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Panel Installation</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/installation-guides/panel/centos7.html" class="sidebar-link">CentOS 7</a></li><li><a href="/community/installation-guides/panel/centos8.html" class="sidebar-link">CentOS 8, Rocky Linux 8, AlmaLinux 8</a></li><li><a href="/community/installation-guides/panel/debian9.html" class="sidebar-link">Debian 9</a></li><li><a href="/community/installation-guides/panel/debian10.html" class="sidebar-link">Debian 10</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Wings Installation</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/installation-guides/wings/centos7.html" class="sidebar-link">CentOS 7</a></li><li><a href="/community/installation-guides/wings/centos8.html" class="sidebar-link">CentOS 8, Rocky Linux 8, AlmaLinux 8</a></li><li><a href="/community/installation-guides/wings/debian9.html" class="sidebar-link">Debian 9</a></li><li><a href="/community/installation-guides/wings/debian10.html" class="sidebar-link">Debian 10</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading open"><span>Creating Eggs</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/config/eggs/creating_a_custom_egg.html" aria-current="page" class="active sidebar-link">Creating a Custom Egg</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/community/config/eggs/creating_a_custom_egg.html#create-new-option" class="sidebar-link">Create New Option</a></li><li class="sidebar-sub-header"><a href="/community/config/eggs/creating_a_custom_egg.html#configure-process-management" class="sidebar-link">Configure Process Management</a></li><li class="sidebar-sub-header"><a href="/community/config/eggs/creating_a_custom_egg.html#copy-settings-from" class="sidebar-link">Copy Settings From</a></li><li class="sidebar-sub-header"><a href="/community/config/eggs/creating_a_custom_egg.html#egg-variables" class="sidebar-link">Egg Variables</a></li><li class="sidebar-sub-header"><a href="/community/config/eggs/creating_a_custom_egg.html#list-of-default-variables" class="sidebar-link">List of default variables</a></li></ul></li><li><a href="/community/config/eggs/creating_a_custom_image.html" class="sidebar-link">Creating a Custom Docker Image</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Game Configuration</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/games/minecraft.html" class="sidebar-link">Minecraft</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Tutorials</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/config/nodes/add_node.html" class="sidebar-link">Creating a New Node</a></li><li><a href="/community/tutorials/artisan.html" class="sidebar-link">Artisan CLI</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Customization</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/customization/panel.html" class="sidebar-link">Building Panel Assets</a></li><li><a href="/community/customization/wings.html" class="sidebar-link">Building Wings</a></li></ul></div></li></ul> </div> <div class="page"> <div class="content content__default"><h1 id="creating-a-custom-egg"><a href="#creating-a-custom-egg" class="header-anchor">#</a> Creating a Custom Egg</h1> <div class="custom-block warning"><p class="custom-block-title">WARNING</p> <p>You should not edit existing services or options that ship with the Panel. Each upgrade we push can make minor
|
|
changes to these, and you'll lose any changes you've made.</p></div> <p></p><div class="table-of-contents"><ul><li><a href="#create-new-option">Create New Option</a></li><li><a href="#configure-process-management">Configure Process Management</a><ul><li><a href="#stop-command">Stop Command</a></li><li><a href="#log-storage">Log Storage</a></li><li><a href="#configuration-files">Configuration Files</a></li><li><a href="#start-configuration">Start Configuration</a></li></ul></li><li><a href="#copy-settings-from">Copy Settings From</a></li><li><a href="#egg-variables">Egg Variables</a></li><li><a href="#list-of-default-variables">List of default variables</a></li></ul></div><p></p> <p>The first thing you'll need to do is create a new service. In this case, the name and description speak for themselves
|
|
in this case. The <code>Folder Name</code> <em>must be a unique name</em> not being used by any other service, and should only
|
|
contain letters, numbers, underscores, and dashes. This is the name of the folder where the daemon will be storing
|
|
the service options on the daemon.</p> <p>The default start command is also required, however it can be changed per-option.</p> <h2 id="create-new-option"><a href="#create-new-option" class="header-anchor">#</a> Create New Option</h2> <p>After creating the service, in the bottom right of the page you should see a button titled <code>New Egg</code>, press it.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Select.5a2867ee.png" alt=""></p> <p>You will be taken to a new service option page which is where most of the configuration happens. The first thing
|
|
you need to do is select your service that you created previously from the <code>Associated Nest</code> dropdown.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Process_Management.516b5b6f.png" alt=""></p> <p>After that, enter an Option Name to describe it, in this case I am using <code>Widget</code>. You will also need to provide a
|
|
<em>valid</em> docker image, as well as a start command to be assigned to servers under this service option (remember, this
|
|
can be tweaked per-server if needed).</p> <p><em>Docker images must be specifically designed to work with Pterodactyl Panel.</em> You should read more about that in
|
|
our <a href="/community/config/eggs/creating_a_custom_image.html">Creating a Docker Image</a> guide.</p> <h2 id="configure-process-management"><a href="#configure-process-management" class="header-anchor">#</a> Configure Process Management</h2> <p>This is perhaps the most important step in this service option configuration, as this tells the Daemon how to run everything.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Process_Management.516b5b6f.png" alt=""></p> <p>The first field you'll encounter is <code>Copy Settings From</code>. The default selection is <code>None</code>. That is expected, and okay.
|
|
This dropdown is discussed at the end of this article.</p> <h3 id="stop-command"><a href="#stop-command" class="header-anchor">#</a> Stop Command</h3> <p>Next, you'll encounter <code>Stop Command</code> and, as the name implies, this should be the command used to safely stop the
|
|
option. For some games, this is <code>stop</code> or <code>end</code>. Certain programs and games don't have a specified stop command, so
|
|
you can enter <code>^C</code> to have the daemon execute a <code>SIGINT</code> to end the process.</p> <h3 id="log-storage"><a href="#log-storage" class="header-anchor">#</a> Log Storage</h3> <p>Logs are competely handeled by the daemon now and use the docker logs to output the complete output from the server.
|
|
This can be set like below.</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span><span class="token punctuation">}</span>
|
|
</code></pre></div><h3 id="configuration-files"><a href="#configuration-files" class="header-anchor">#</a> Configuration Files</h3> <p>The next block is one of the most complex blocks, the <code>Configuration Files</code> descriptor. The Daemon will process this
|
|
block prior to booting the server to ensure all of the required settings are defined and set correctly.</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
|
|
<span class="token property">"server.properties"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
<span class="token property">"parser"</span><span class="token operator">:</span> <span class="token string">"properties"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"find"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
<span class="token property">"server-ip"</span><span class="token operator">:</span> <span class="token string">"0.0.0.0"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"enable-query"</span><span class="token operator">:</span> <span class="token string">"true"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"server-port"</span><span class="token operator">:</span> <span class="token string">"{{server.build.default.port}}"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"query.port"</span><span class="token operator">:</span> <span class="token string">"{{server.build.default.port}}"</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
</code></pre></div><p>In this example, we are telling the Daemon to read <code>server.properties</code> in <code>/home/container</code>. Within this block, we
|
|
define a <code>parser</code>, in this case <code>properties</code> but the following are <a href="https://github.com/pterodactyl/wings/blob/develop/parser/parser.go#L25-L30" target="_blank" rel="noopener noreferrer">valid parsers<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>:</p> <ul><li><code>file</code> — This parser goes based on matching the beginning of lines, and not a specific property like the other five.
|
|
Avoid using this parser if possible.</li> <li><code>yaml</code> (supports <code>*</code> notation)</li> <li><code>properties</code></li> <li><code>ini</code></li> <li><code>json</code> (supports <code>*</code> notation)</li> <li><code>xml</code></li></ul> <p>Once you have defined a parser, we then define a <code>find</code> block which tells the Daemon what specific elements to find
|
|
and replace. In this example, we have provided four separate items within the <code>server.properties</code> file that we want to
|
|
find and replace to the assigned values. You can use either an exact value, or define a specific server setting from
|
|
the <code>server.json</code> file. In this case, we're assigning the default server port to be used as the <code>server-port</code> and
|
|
<code>query.port</code>. <strong>These placeholders are case sensitive, and should have no spaces in them.</strong></p> <p>You can have multiple files listed here, the Daemon will process them in parallel before starting the server. When
|
|
using <code>yaml</code> or <code>json</code> you can use more advanced searching for elements.</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
|
|
<span class="token property">"config.yml"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
<span class="token property">"parser"</span><span class="token operator">:</span> <span class="token string">"yaml"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"find"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
<span class="token property">"listeners[0].query_enabled"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
|
<span class="token property">"listeners[0].query_port"</span><span class="token operator">:</span> <span class="token string">"{{server.build.default.port}}"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"listeners[0].host"</span><span class="token operator">:</span> <span class="token string">"0.0.0.0:{{server.build.default.port}}"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"servers.*.address"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
<span class="token property">"127.0.0.1"</span><span class="token operator">:</span> <span class="token string">"{{config.docker.interface}}"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"localhost"</span><span class="token operator">:</span> <span class="token string">"{{config.docker.interface}}"</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
</code></pre></div><p>In this example, we are parsing <code>config.yml</code> using the <code>yaml</code> parser. The first three find items are simply assigning
|
|
ports and IPs for the first listener block. The last one, <code>servers.*.address</code> uses wildcard matching to match any items
|
|
within the <code>servers</code> block, and then finding each <code>address</code> block for those items.</p> <div><p>An advanced feature of this file configuration is the ability to define multiple find and replace statements for a
|
|
single matching line. In this case, we are looking for either <code>127.0.0.1</code> or <code>localhost</code> and replacing them with the
|
|
docker interface defined in the configuration file using <code>{{config.docker.interface}}</code>.</p></div><h3 id="start-configuration"><a href="#start-configuration" class="header-anchor">#</a> Start Configuration</h3> <p>The last block to configure is the <code>Start Configuration</code> for servers running using this service option.</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
|
|
<span class="token property">"done"</span><span class="token operator">:</span> <span class="token string">")! For help, type "</span><span class="token punctuation">,</span>
|
|
<span class="token property">"userInteraction"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
|
|
<span class="token string">"Go to eula.txt for more info."</span>
|
|
<span class="token punctuation">]</span>
|
|
<span class="token punctuation">}</span>
|
|
</code></pre></div><p>In the example block above, we define <code>done</code> as the entire line, or part of a line that indicates a server is done
|
|
starting, and is ready for players to join. When the Daemon sees this output, it will mark the server as <code>ON</code> rather
|
|
than <code>STARTING</code>. We can also define <code>userInteraction</code> as an array of lines that should indicate that the server
|
|
<em>did not crash</em>, but rather stopped because the user needs to perform some action.</p> <p>In this case, we define it as the line asking users to agree to the EULA. You are not required to have
|
|
<code>userInteraction</code> lines, however if you are going to leave it empty, it should still be defined with an empty array,
|
|
as shown below:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
|
|
<span class="token property">"done"</span><span class="token operator">:</span> <span class="token string">")! For help, type "</span><span class="token punctuation">,</span>
|
|
<span class="token property">"userInteraction"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
|
<span class="token punctuation">}</span>
|
|
</code></pre></div><p>That concludes basic service option configuration.</p> <h2 id="copy-settings-from"><a href="#copy-settings-from" class="header-anchor">#</a> Copy Settings From</h2> <p>As mentioned above, there is a unique <code>Copy Settings From</code> dropdown when adding a new option. This gives you the
|
|
ability to, as the name suggests, copy settings defined above from a different option.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Copy_Settings_From.e3102cdd.png" alt=""></p> <p>In the panel, we use this to copy settings that remain the same between similar service options, such as many of the
|
|
Minecraft options.</p> <p>For example, lets look at the <code>Sponge (SpongeVanilla)</code> service option.</p> <p>As you can see, it as been told to copy settings from <code>Vanilla Minecraft</code>. This means that any of the fields that are
|
|
left blank will inherit from the assigned parent. We then define a specific <code>userInteraction</code> line that is different in
|
|
Sponge compared to Vanilla, but tell it that everything else should remain the same.</p> <p><em>Please note that <code>Copy Settings From</code> does not support nested copies, you can only copy from a single parent,
|
|
and that parent <strong>must not be copying from another option.</strong></em></p> <h2 id="egg-variables"><a href="#egg-variables" class="header-anchor">#</a> Egg Variables</h2> <p>One of the great parts of the Egg Variables is the ability to define specific variables that users and/or admins can
|
|
control to tweak different settings without letting users modify the startup command. To create new variables, or edit
|
|
existing ones, visit the new service option you created, and click the <code>Variables</code> tab at the top of the page. Lets take
|
|
a look at an example variable that we can create.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Variables.3962b264.png" alt=""></p> <div><p>The name and description are rather self-explanitory, so I'll skip down to the <code>Environment Variable</code> box. This should
|
|
be an Alpha-Numeric name with underscores, and should be uppercase. This will be the name of the environment variable
|
|
which can be accessed in the startup command as <code>{{WOOZLE_WOO}}</code>, within file modifications as <code>{{env.WOOZLE_WOO}}</code>, or
|
|
just <code>${WOOZLE_WOO}</code> in any shell scripts (it is passed through in the environment). We also define a default value for
|
|
this environment variable in this example, but it is not required to do so.</p></div><p>The next section is <code>Permissions</code>, which is a dropdown with two options: <code>Users Can View</code> and <code>Users Can Edit</code>.</p> <ul><li><code>Users Can View</code> — allows a user to view the field on the front-end, as well as the assigned value of that variable.
|
|
They will be able to see it replaced in their startup command.</li> <li><code>Users Can Edit</code> — allows a user to edit the value of the variable, for example the name of their <code>server.jar</code> file
|
|
if running Minecraft.</li></ul> <p>You should use caution here, even if you assign neither of the permissions it does not mean that the value will be
|
|
hidden. Crafty users will still be able to get the environment on their server. In most cases this is simply hiding
|
|
it from the user, and then used within the Dockerfile to perform actions, thus it is not important for the user to see.</p> <p>Finally, you will need to define some input rules to validate the value against. In this example, we use
|
|
<code>required|string|between:1,10</code>, which means the field is <code>required</code>, must be a <code>string</code>, and must be between <code>1</code> and
|
|
<code>10</code> characters in length. You can find <a href="https://laravel.com/docs/5.6/validation#available-validation-rules" target="_blank" rel="noopener noreferrer">all of the available validation rules<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>
|
|
on the Laravel website. You can also use ReGEX based validation by using the <code>regex:</code> rule flag. For example,
|
|
<a href="https://regex101.com/r/k4oEOn/1" target="_blank" rel="noopener noreferrer"><code>required|regex:/^([\w\d._-]+)(\.jar)$/</code><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> will require the field, and will match the
|
|
regex as any letters or numbers (<code>\w\d</code>) including underscore (<code>_</code>), periods (<code>.</code>), and dashes (<code>-</code>) ending in <code>.jar</code>.</p> <p>They will then be visible when managing the startup for a server in both the Admin CP and on the Front-End.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Startup.b6e22637.png" alt=""></p> <h2 id="list-of-default-variables"><a href="#list-of-default-variables" class="header-anchor">#</a> List of default variables</h2> <p>The default variables are always accessible to all eggs and don't have to be created separately. They can be used in the egg startup, install script, or the configuration file parser.</p> <table><thead><tr><th>Variable</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>TZ</td> <td>Time Zone</td> <td><code>Etc/UTC</code></td></tr> <tr><td>STARTUP</td> <td>Startup command of the egg</td> <td><code>java -Xms128M -XmxM -jar </code></td></tr> <tr><td>SERVER_MEMORY</td> <td>Memory available for the server in MB</td> <td><code>512</code></td></tr> <tr><td>SERVER_IP</td> <td>Default ip of the server</td> <td><code>127.0.0.1</code></td></tr> <tr><td>SERVER_PORT</td> <td>Primary Server Port</td> <td><code>27015</code></td></tr> <tr><td>P_SERVER_LOCATION</td> <td>Location of the server</td> <td><code>Example City</code></td></tr> <tr><td>P_SERVER_UUID</td> <td>UUID of the server</td> <td><code>539fdca8-4a08-4551-a8d2-8ee5475b50d9</code></td></tr> <tr><td>P_SERVER_ALLOCATION_LIMIT</td> <td>Limit of allocations allowed for the server</td> <td><code>0</code></td></tr></tbody></table></div> <div class="page-edit"><div class="edit-link"><a href="https://github.com/pterodactyl/documentation/edit/master/community/config/eggs/creating_a_custom_egg.md" target="_blank" rel="noopener noreferrer">Help us improve this page.</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <!----></div> <div class="page-nav"><p class="inner"></p> <div class="prev"><span>
|
|
←
|
|
<a href="/community/installation-guides/wings/debian10.html">Debian 10</a></span></div> <div class="next"><span><a href="/community/config/eggs/creating_a_custom_image.html">Creating a Custom Docker Image</a>→
|
|
</span></div></div> </div></div></div><div class="global-ui"></div></div>
|
|
<script src="/assets/js/app.6ca2c4a6.js" defer></script><script src="/assets/js/4.babf7215.js" defer></script><script src="/assets/js/1.79a56ae5.js" defer></script><script src="/assets/js/12.2e01246c.js" defer></script>
|
|
</body>
|
|
</html>
|