Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

crafty-freebsd-install

Manual installation of Crafty Controller on FreeBSD. Crafty Controller is a free and open-source Minecraft launcher and manager.

This document is aiming to provide a complete production ready setup.

General considerations

You can use a dedicated machine or a jail for Crafty Controller. Jails allow keeping applications separated so you never run into dependency conflicts of packages.

This guide assumes you are working from a root shell. No sudo for each command as seems to be preferred in Debian or Ubuntu based howtos, because sudo is not part of the FreeBSD base system. Use SSH login to root (following Ubuntu and setting PermitRootLogin prohibit-password for that) or use su - or sudo -s as preferred.

Installation

  • Make sure DNS and NTP are configured correctly and working.
  • Make sure procfs(4) and linprocfs(4) are mounted.

Install required packages

Configure pkg to use "latest" instead of "quarterly" repository

mkdir -p /usr/local/etc/pkg/repos
echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest" }' >/usr/local/etc/pkg/repos/FreeBSD.conf
pkg upgrade -y
pkg autoremove -y

Install packages

pkg install python3 py311-pip py311-sqlite3 py311-supervisor openjdk25 bash git-tiny rust

Create Crafty Controller user and directories

Create user

pw useradd -n crafty -d /var/games/minecraft -s /usr/local/bin/bash -m

Create and activate virtual environment

su - crafty
python3 -m venv .venv
. .venv/bin/activate

Checkout Crafty Controller source code and build dependencies

git clone https://gitlab.com/crafty-controller/crafty-4.git crafty
cd crafty
pip3 install --no-cache-dir -r requirements.txt
pip install --upgrade pip

Create servers directory

mkdir /var/games/minecraft/servers

Log out of crafty user back into root

Ctrl-D

Setup supervisord and start Crafty Controller

Add Crafty Controller to supervised services

cat <<EOF >>/usr/local/etc/supervisord.conf
[program:crafty]
command=/var/games/minecraft/.venv/bin/python3 main.py -d
directory=/var/games/minecraft/crafty
user=crafty
environment=TZ="Europe/Berlin",PATH="/usr/local/bin:/usr/bin:/bin"
EOF

Adjust time zone as you see fit.

Enable and start supervisord

sysrc supervisord_enable="YES"
service supervisord start

Check if Crafty Controller is running

supervisorctl status

Get initial admin credentials

cat /var/games/minecraft/crafty/app/config/default-creds.txt

Congratulations! Installation is done!

Access the UI and final steps

  • Open https://<ip of your server>:8443 in your browser bypassing the TLS certificate warning
  • Use the credentials from the last step to log in
  • Click on Panel Settings in the left hand menu, change the Global Servers Directory from /var/games/minecraft/crafty to /var/games/minecraft and click Submit

That's it! Happy minecrafting!

Update Crafty Controller

The dashboard will notify you of updates to Crafty Controller. If a new version is available follow these steps to update.

Preparation

Switch to the crafty user

Starting logged in as root do:

su - crafty

Activate your virtual environment

. .venv/bin/activate

Update

Fetch the latest source

cd crafty
git reset --hard origin/master
git fetch && git pull

Perform the update proper

pip3 install -r requirements.txt --no-cache-dir

Log out of crafty user back into root

Ctrl-D

Restart Crafty Controller

supervisorctl restart crafty

Recreate your virtual environment in case something is broken

If for any reason e.g. during an update your virtual Python environment seems broken (errors like pip3: command not found) you can recreate it at any time this way:

As the crafty user

cd
rm -r .venv
python3 -m venv .venv

This should rarely be necessary.


EOF

About

Manual installation of Crafty Controller on FreeBSD

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors