<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Frederic Alix</title>
    <description>The latest articles on DEV Community by Frederic Alix (@fredericalix).</description>
    <link>https://dev.to/fredericalix</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F263765%2F70e576d9-d351-4b59-b5f0-840f76567037.jpg</url>
      <title>DEV Community: Frederic Alix</title>
      <link>https://dev.to/fredericalix</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fredericalix"/>
    <language>en</language>
    <item>
      <title>Hosting a PaperMC Minecraft Server on Clever Cloud</title>
      <dc:creator>Frederic Alix</dc:creator>
      <pubDate>Sat, 11 Feb 2023 13:31:58 +0000</pubDate>
      <link>https://dev.to/fredericalix/hosting-a-papermc-minecraft-server-on-clever-cloud-ocp</link>
      <guid>https://dev.to/fredericalix/hosting-a-papermc-minecraft-server-on-clever-cloud-ocp</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Clever Cloud allows you to host your web applications (nodejs, java, php, and more) and databases (PostgreSQL, MySQL, Mongo, ...). Your application must necessarily listen on port 8080 so that clever Cloud redirects its load balancer and monitors the status of your application. This poses a problem for us, as a Minecraft server is not an HTTP server. In this article, we will see how to overcome this problem by using an additional TCP port provided by Clever Cloud and run an HTTP server within our application to serve as a relay on a Minecraft instance console.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OpenJDK 17&lt;/li&gt;
&lt;li&gt;wget utility&lt;/li&gt;
&lt;li&gt;clever-tools (&lt;a href="https://www.clever-cloud.com/doc/getting-started/cli/" rel="noopener noreferrer"&gt;https://www.clever-cloud.com/doc/getting-started/cli/&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create a directory to prepare the files to be sent to the Clever Cloud platform&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /var/tmp/
mkdir papermc
export PAPERMCDIR=/var/tmp/papermc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Download PaperMC
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://api.papermc.io/v2/projects/paper/versions/1.19.3/builds/386/downloads/paper-1.19.3-386.jar -O paper.jar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Prepare PaperMC before deploying to Clever Cloud
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Start PaperMC to generate the server directories
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;java -Xms2G -Xmx2G -jar paper.jar --nogui

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Accept the Minecraft license
&lt;/h3&gt;

&lt;p&gt;Edit the eula.txt file and change the &lt;code&gt;eula=false&lt;/code&gt; parameter to &lt;code&gt;eula=true&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Start PaperMC to generate the rest of the server directories and files
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;java -Xms2G -Xmx2G -jar paper.jar --nogui

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To exit the server console, type the &lt;code&gt;stop&lt;/code&gt; command&lt;/p&gt;

&lt;h3&gt;
  
  
  Server Configuration
&lt;/h3&gt;

&lt;p&gt;Edit the &lt;code&gt;server.properties&lt;/code&gt; file and modify the following parameters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
query.port=4040
...
server-port=4040

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, your Minecraft server will listen on TCP port 4040, which is necessary to use the TCP Transport function offered by Clever Cloud (&lt;a href="https://www.clever-cloud.com/doc/administrate/tcp-redirections/" rel="noopener noreferrer"&gt;lien&lt;/a&gt;)&lt;/p&gt;

&lt;h3&gt;
  
  
  Web Console Installation
&lt;/h3&gt;

&lt;p&gt;It is important to be able to manage your Minecraft instance with the console. We will be able to use this fantastic plugin to meet our needs :&lt;br&gt;
&lt;a href="https://github.com/mesacarlos/WebConsole" rel="noopener noreferrer"&gt;WebConsole&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  The server plugin
&lt;/h4&gt;

&lt;p&gt;Go to the plugins directory of your PaperMC installation and run the following command :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd plugins
wget https://github.com/mesacarlos/WebConsole/releases/download/v2.5/WebConsole-2.5.jar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the server to generate the configuration file and then modify it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd $PAPERMCDIR
java -Xms2G -Xmx2G -jar paper.jar --nogui
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the server has started, stop it with the command &lt;code&gt;stop&lt;/code&gt;&lt;br&gt;
Go to the plugin installation directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd plugins/WebConsole
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit the &lt;code&gt;config.yml&lt;/code&gt; file and replace its entire content with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useSSL: false
StoreType: JKS
KeyStore: plugins/WebConsole/keystore.jks
StorePassword: pasbesoin
KeyPassword: pasbesoin
host: 127.0.0.1
port: 8181
language: en
passwords:
  admin:
    administrateur:
      password: myserverpassword
      commandWhitelist:
        enabled: false
        commandWhitelistActsAsBlacklist: false
        whitelist:
        - whisper
        - gamemode survival
  viewer: {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Web Server
&lt;/h4&gt;

&lt;p&gt;We need an HTTP server to distribute the web console's web interface and that must also act as a reverse-proxy on the plugin's websocket server. The simplest is to use Caddy. It is very easy to configure and does not consume a lot of memory. Let's start by downloading the front-end web.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd $PAPERMCDIR
mkdir html
cd html
wget https://github.com/mesacarlos/WebConsole/releases/download/v2.4/client-2.4.zip
unzip client-2.4.zip
rm client-2.4.zip
cd ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will then download the HTTP server binary, &lt;a href="https://caddyserver.com/download" rel="noopener noreferrer"&gt;Caddy&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir bin
cd bin
wget "https://caddyserver.com/api/download?os=linux&amp;amp;arch=amd64&amp;amp;idempotency=74870526505028" -O caddy
chmod a+x caddy
cd ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the root of your project, create the Caddyfile file and insert the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
        http_port 8080
}

:8080 {
        root * ./html/client
        file_server
        @websockets {
                header Connection *Upgrade*
                header Upgrade websocket
        }
        reverse_proxy @websockets localhost:8181
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deployment on Clever Cloud
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Creation of the application on Clever Cloud
&lt;/h3&gt;

&lt;p&gt;We'll use clever-tools for the next operations. If this program is not yet installed and configured on your computer, please refer to the official documentation to do so :&lt;br&gt;
&lt;a href="https://www.clever-cloud.com/doc/getting-started/cli/" rel="noopener noreferrer"&gt;clever tools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Still in the directory where you configured PaperMC, run the following commands to create and configure the application on Clever Cloud :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd $PAPERMCDIR
clever login
clever create MineCraft --type jar --org &amp;lt;YOUR_ORGA_ID&amp;gt; --region par
clever config update --enable-force-https
clever scale --alias MineCraft --flavor M
clever addon create fs-bucket Minecraft-Data --link MineCraft --plan s --yes
clever tcp-redirs add --namespace cleverapps --alias MineCraft
clever env set CC_JAVA_VERSION 17
clever env set CC_JAR_PATH "./"
clever env set CC_RUN_COMMAND "java -Xms3G -Xmx3G -jar paper.jar --nogui --world-dir ./worlds-data"
clever env set CC_PRE_RUN_HOOK "nohup ./bin/caddy run --config Caddyfile &amp;amp;"
clever env set CC_FS_BUCKET "/worlds-data:`clever env | awk -F = '/BUCKET_HOST/ { print $2}'|sed 's/"//g'`"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt;  after validating the command &lt;code&gt;clever tcp-redirs add --namespace cleverapps --alias MineCraft&lt;/code&gt;, clever-tools will display a message "Successfully added tcp redirection on port: xxxxx". Make sure to note this port, as you will need it to connect to the Minecraft server from your client.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deployment
&lt;/h3&gt;

&lt;p&gt;To deploy the Minecraft Server application, we will use git. However, it is out of the question to use this technique to send the files of your worlds. As an application on clever Cloud is immutable, we will have to send the world data to the FS Bucket in order to recover the state of the game at the next server launch. We will connect to the FS Bucket via FTP to send our world files. To find the FTP server connection information for your FS Bucket, go to the Clever Cloud web console:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlsnyinjjpwst7rb9rdm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlsnyinjjpwst7rb9rdm.png" alt="Image description" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use FileZilla to send my files via FTP to the FS Bucket:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwpfowanhf3k9s78mwaep.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwpfowanhf3k9s78mwaep.png" alt="Image description" width="800" height="522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the transfer is complete, type the following commands to deploy the application on Clever Cloud.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd $PAPERMCDIR
rm -rf world*
git init
git add *
git commit -m "First deploy"
clever deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your server will be ready in a few minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's play a little !
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Access the Web Console
&lt;/h3&gt;

&lt;p&gt;Just log in directly to your clever Cloud application URL. To find the URL, go to the clever Cloud console and click on the link:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3t5vuww0sawnw7aywks1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3t5vuww0sawnw7aywks1.png" alt="Image description" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You are now on the client interface of the Web Console.&lt;br&gt;
Create a new connection:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqr2jnuegbqknqxnl0ovb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqr2jnuegbqknqxnl0ovb.png" alt="Image description" width="800" height="549"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The server will ask for a password that we have provided in the plugin configuration file. In our case, it's &lt;code&gt;myserverpassword&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fut6kq3q1ronycdslcb6q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fut6kq3q1ronycdslcb6q.png" alt="Image description" width="497" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You are now connected to your instance's console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1454f8ii0ajp4jahgdru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1454f8ii0ajp4jahgdru.png" alt="Image description" width="800" height="608"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with the Minecraft game
&lt;/h3&gt;

&lt;p&gt;You will need the TCP port provided by clever-tools. If you did not note it, you can find it in the Clever Cloud console:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fnmnd3520tp30gdhjo7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fnmnd3520tp30gdhjo7.png" alt="Image description" width="800" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Launch the Minecraft program on your computer and select the Multiplayers / Direct Connection option&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0v6bmt77ffqjp2d00i43.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0v6bmt77ffqjp2d00i43.png" alt="Image description" width="800" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter the name of your clever Cloud server and the TCP port. For example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3t1ew2si6njvmgthjm5b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3t1ew2si6njvmgthjm5b.png" alt="Image description" width="800" height="611"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a few seconds, you only have to play!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hodw2fuhzyfqv0l2zyz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hodw2fuhzyfqv0l2zyz.png" alt="Image description" width="800" height="612"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>learning</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Un serveur Minecraft PaperMC hébergé chez Clever Cloud</title>
      <dc:creator>Frederic Alix</dc:creator>
      <pubDate>Sat, 11 Feb 2023 13:00:54 +0000</pubDate>
      <link>https://dev.to/pancasat/un-serveur-minecraft-papermc-heberge-chez-clever-cloud-2b0a</link>
      <guid>https://dev.to/pancasat/un-serveur-minecraft-papermc-heberge-chez-clever-cloud-2b0a</guid>
      <description>&lt;h2&gt;
  
  
  Présentation
&lt;/h2&gt;

&lt;p&gt;Clever Cloud vous permet d'héberger vos applications web (nodejs, java, php, et plus) ainsi que vos bases de données (PostgreSQL, MySQL, Mongo, ...). Votre application doit obligatoirement écouter sur le port 8080 pour que Clever Cloud redirige son équilibreur de charge dessus et surveille l'état de votre application. Cela nous pose donc un problème, car un serveur Minecraft n'est pas un serveur HTTP. Nous allons voir comment contourner ce problème en utilisant un port TCP supplémentaire proposé par Clever Cloud et faire tourner un serveur HTTP dans notre application pour servir de relais sur la console d'une instance Minecraft.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prérequis
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OpenJDK 17&lt;/li&gt;
&lt;li&gt;wget utility&lt;/li&gt;
&lt;li&gt;clever-tools (&lt;a href="https://www.clever-cloud.com/doc/getting-started/cli/" rel="noopener noreferrer"&gt;https://www.clever-cloud.com/doc/getting-started/cli/&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Créer un répertoire pour préparer les fichiers à envoyer sur la plateforme Clever Cloud&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /var/tmp/
mkdir papermc
export PAPERMCDIR=/var/tmp/papermc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Télécharger PaperMC
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://api.papermc.io/v2/projects/paper/versions/1.19.3/builds/386/downloads/paper-1.19.3-386.jar -O paper.jar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Préparation de PaperMC avant le déploiement sur Clever Cloud
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Lancement de PaperMC pour générer les répertoires  du serveur
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;java -Xms2G -Xmx2G -jar paper.jar --nogui

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Acceptation de la licence de Minecraft
&lt;/h3&gt;

&lt;p&gt;Éditer le fichier eula.txt et modifier le paramètre &lt;code&gt;eula=false&lt;/code&gt; en &lt;code&gt;eula=true&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Lancement de PaperMC pour générer le reste des répertoires et des fichiers du serveur
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;java -Xms2G -Xmx2G -jar paper.jar --nogui

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pour quitter la console du serveur, tapez la commande &lt;code&gt;stop&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration du serveur
&lt;/h3&gt;

&lt;p&gt;Éditer le fichier &lt;code&gt;server.properties&lt;/code&gt; et modifer les paramètres suivants:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
query.port=4040
...
server-port=4040

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Maintenant, votre serveur Minecraft écoutera sur le port TCP 4040, qui est nécessaire pour utiliser la fonction TCP Transport proposée par Clever Cloud (&lt;a href="https://www.clever-cloud.com/doc/administrate/tcp-redirections/" rel="noopener noreferrer"&gt;lien&lt;/a&gt;)&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation de la console web
&lt;/h3&gt;

&lt;p&gt;Il est important de pouvoir administrer son instance Minecraft avec la console. Nous allons pouvoir utiliser ce plugin fantastique pour répondre à nos besoins :&lt;br&gt;
&lt;a href="https://github.com/mesacarlos/WebConsole" rel="noopener noreferrer"&gt;WebConsole&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Le plugin serveur
&lt;/h4&gt;

&lt;p&gt;Allez dans le répertoire plugins de votre installation PaperMC et lancez la commande suivante :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd plugins
wget https://github.com/mesacarlos/WebConsole/releases/download/v2.5/WebConsole-2.5.jar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lancez le serveur pour pouvoir générer le fichier de configuration et le modifier ensuite.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd $PAPERMCDIR
java -Xms2G -Xmx2G -jar paper.jar --nogui
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Une fois le serveur démarré, arrêtez-le avec la commande &lt;code&gt;stop&lt;/code&gt;&lt;br&gt;
Allez dans le répertoire d'installation du plugin&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd plugins/WebConsole
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Editez le fichier &lt;code&gt;config.yml&lt;/code&gt; et remplacez l'intégralité de son contenu par celui-ci:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useSSL: false
StoreType: JKS
KeyStore: plugins/WebConsole/keystore.jks
StorePassword: pasbesoin
KeyPassword: pasbesoin
host: 127.0.0.1
port: 8181
language: fr
passwords:
  admin:
    administrateur:
      password: myserverpassword
      commandWhitelist:
        enabled: false
        commandWhitelistActsAsBlacklist: false
        whitelist:
        - whisper
        - gamemode survival
  viewer: {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Serveur web
&lt;/h4&gt;

&lt;p&gt;Nous avons besoin d'un serveur HTTP pour distribuer l'interface web de la console web et qui doit également faire office de reverse-proxy sur le serveur websocket du plugin. Le plus simple est d'utiliser Caddy. Il est très simple à configurer et ne consomme pas beaucoup de mémoire. Commençons déjà par télécharger le front-end web.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd $PAPERMCDIR
mkdir html
cd html
wget https://github.com/mesacarlos/WebConsole/releases/download/v2.4/client-2.4.zip
unzip client-2.4.zip
rm client-2.4.zip
cd ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nous allons ensuite télecharger le binaire du serveur http, &lt;a href="https://caddyserver.com/download" rel="noopener noreferrer"&gt;Caddy&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir bin
cd bin
wget "https://caddyserver.com/api/download?os=linux&amp;amp;arch=amd64&amp;amp;idempotency=74870526505028" -O caddy
chmod a+x caddy
cd ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;À la racine de votre projet, créez le fichier Caddyfile et insérez-y les lignes suivantes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
        http_port 8080
}

:8080 {
        root * ./html/client
        file_server
        @websockets {
                header Connection *Upgrade*
                header Upgrade websocket
        }
        reverse_proxy @websockets localhost:8181
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Déploiement sur Clever Cloud
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Création de l'application sur Clever Cloud
&lt;/h3&gt;

&lt;p&gt;Nous allons utiliser clever-tools pour les prochaines opérations. Si ce programme n'est pas encore installé et configuré sur votre ordinateur, veuillez consulter la documentation officielle pour le faire :&lt;br&gt;
&lt;a href="https://www.clever-cloud.com/doc/getting-started/cli/" rel="noopener noreferrer"&gt;clever tools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Toujours dans le répertoire où vous avez configuré PaperMC, lancez les commandes suivantes pour créer et configurer l'application sur Clever Cloud :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd $PAPERMCDIR
clever login
clever create MineCraft --type jar --org &amp;lt;ID_DE_VOTRE_ORGA&amp;gt; --region par
clever config update --enable-force-https
clever scale --alias MineCraft --flavor M
clever addon create fs-bucket Minecraft-Data --link MineCraft --plan s --yes
clever tcp-redirs add --namespace cleverapps --alias MineCraft
clever env set CC_JAVA_VERSION 17
clever env set CC_JAR_PATH "./"
clever env set CC_RUN_COMMAND "java -Xms3G -Xmx3G -jar paper.jar --nogui --world-dir ./worlds-data"
clever env set CC_PRE_RUN_HOOK "nohup ./bin/caddy run --config Caddyfile &amp;amp;"
clever env set CC_FS_BUCKET "/worlds-data:`clever env | awk -F = '/BUCKET_HOST/ { print $2}'|sed 's/"//g'`"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt;  après avoir validé la commande "clever tcp-redirs add --namespace Cleverapps --alias MineCraft", clever-tools affichera un message "Successfully added tcp redirection on port : xxxxx". Notez bien ce port, car vous en aurez besoin pour vous connecter au serveur Minecraft depuis votre client.&lt;/p&gt;

&lt;h3&gt;
  
  
  Déploiement
&lt;/h3&gt;

&lt;p&gt;Pour déployer l'application Minecraft Server, nous allons utiliser git. Cependant, il est hors de question d'utiliser cette technique pour envoyer les fichiers de vos mondes. Comme une application sur Clever Cloud est immutable, nous devrons envoyer les données des mondes sur le FS Bucket afin de retrouver l'état d'avancement du jeu au prochain lancement du serveur. Nous allons nous connecter au FS Bucket via FTP afin d'y envoyer nos fichiers mondes. Pour trouver les informations de connexion au serveur FTP de votre FS Bucket, allez sur la console web de Clever Cloud:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlsnyinjjpwst7rb9rdm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlsnyinjjpwst7rb9rdm.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;J'utilise FileZilla pour envoyer mes fichiers via FTP sur le FS Bucket:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwpfowanhf3k9s78mwaep.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwpfowanhf3k9s78mwaep.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Une fois le transfert terminé, tapez les commandes suivantes pour déployer l'application sur Clever Cloud:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd $PAPERMCDIR
rm -rf world*
git init
git add *
git commit -m "Premier deploiement"
clever deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Quelques minutes plus tard, votre serveur sera fin prêt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jouons un peu !
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Accéder à la WebConsole
&lt;/h3&gt;

&lt;p&gt;Il suffit de se connecter directement à l'URL de votre application Clever Cloud.&lt;br&gt;
Pour trouver l'URL, allez sur la console de Clever Cloud et cliquez sur le lien suivant:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3t5vuww0sawnw7aywks1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3t5vuww0sawnw7aywks1.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Vous voilà sur l'interface client de la WebConsole.&lt;br&gt;
Créez une nouvelle connection:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqr2jnuegbqknqxnl0ovb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqr2jnuegbqknqxnl0ovb.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Le serveur vous demandera un mot de passe que nous avons renseigné dans le fichier de configuration du plugin. Dans notre cas, c'est &lt;code&gt;myserverpassword&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fut6kq3q1ronycdslcb6q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fut6kq3q1ronycdslcb6q.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Vous voilà maintenant connecté à la console de votre instance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1454f8ii0ajp4jahgdru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1454f8ii0ajp4jahgdru.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Se connecter avec le jeu Minecraft
&lt;/h3&gt;

&lt;p&gt;Vous aurez besoin du port TCP fourni par clever-tools. Si vous ne l'avez pas noté, vous pouvez le retrouver dans la console de Clever Cloud.:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fnmnd3520tp30gdhjo7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fnmnd3520tp30gdhjo7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lancez le programme Minecraft sur votre machine et sélectionnez l'option de Multiplayers / Direct Connection&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0v6bmt77ffqjp2d00i43.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0v6bmt77ffqjp2d00i43.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Entrez le nom de votre serveur Clever Cloud ainsi que le port TCP.&lt;br&gt;
Exemple:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3t1ew2si6njvmgthjm5b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3t1ew2si6njvmgthjm5b.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Après quelques secondes, il ne vous reste plus qu'a jouer !&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hodw2fuhzyfqv0l2zyz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hodw2fuhzyfqv0l2zyz.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>minecraft</category>
      <category>paas</category>
      <category>clevercloud</category>
    </item>
  </channel>
</rss>
