This document describes how to build and install the Crossfire server from source.
Instructions for building the client are on a separate page.
It's likely that many of these packages (listed alphabetically) are already installed on your system, but this list is a way to make sure. It's important to have all the right packages in place before attempting any builds or compiles.
As a quick reference:
sudo apt-get install automake flex gcc g++ git libgd-dev libgd-tools libtool make python3-dev
A special note about installing python. The package listed above, python3-dev, should install the necessary packages to enable many of the in-game features (ship transportation, guilds, post office, et al.) to work.
However, if python related features are not working, then installing python depends on your choice of Linux distro.
As an example, this is what you would use to install python on Ubuntu Focal:
sudo apt-get install python3-dev
To confirm python is fully installed on Ubuntu Focal:
$ python3 -V
And you should see output like:
Python 3.10.12
The recommended packages provide additional add-ons or features (summaries included, below) to the server or as a way to test new functions and features.
As a quick reference:
sudo apt-get install check autoconf libsqlite3-0 libpython3.8 libcurl4 libcurl4-openssl-dev
These useful packages are not normally required for end-user builds, but they come in handy in cases where developers may have forgotten to check in changes to build scripts, etc.
- placeholder text.
A quick reference for Debian 10
sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite
It is important to run this command after the server compile process listed further down in the page:
$ sudo chown -R <username>.<username> /usr/games/crossfire
Instructions creation date: 2024-January-9
Last tested date: 2024-April-29
A quick reference for Debian 11
sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite3
It is important to run this command after the server compile process listed further down in the page:
$ sudo chown -R <username>.<username> /usr/games/crossfire
Instructions creation date: 2024-January-10
Last tested date: 2024-April-29
A quick reference for Debian 12
sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite3
It is important to run this command after the server compile process listed further down in the page.
Note: Debian 12 requires the directory permission change to use ':' instead of '.' like this,
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-January-10
Last tested date: 2024-April-29
A quick reference for Devuan Beowulf 3.1.1
sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite3
Instructions creation date: 2024-May-1
Last tested date: 2024-May-1
A quick reference for Devuan Chimaera 4.0 (old stable)
sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite3
Instructions creation date: 2024-February-20
Last tested date: 2024-May-2
A quick reference for Devuan Daedalus 5.0 (stable)
sudo apt install automake flex git g++ libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool make python3-bsddb3 python3-devel sqlite3
After compiling the server (sh autogen.sh && make && sudo make install) you will also need to run the following command - but make sure to change <username> to the correct login name for you setup:
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-February-21
Last tested date: 2024-May-03
A quick reference for Fedora 37
sudo dnf install flex g++ git libcurl libcurl-devel libtool make python3 python3-devel
After compiling the server (sh autogen.sh && make && sudo make install) you will also need to run the following command - but make sure to change <username> to the correct login name for you setup:
sudo chown -R <username>.<username> /usr/games/crossfire/
Note: if you see an alert like this, “ chown: warning: '.' should be ':' ” then use this syntax:
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-January-29
Last tested date: 2024-January-29
A quick reference for Fedora 38
sudo dnf install flex g++ git libcurl libcurl-devel libtool make python3 python3-bsddb3 python3-devel sqlite
After compiling the server (sh autogen.sh && make && sudo make install) you will also need to run the following command - but make sure to change <username> to the correct login name for you setup:
sudo chown -R <username>.<username> /usr/games/crossfire/
Note: if you see an alert like this, “ chown: warning: '.' should be ':' ” then use this syntax:
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-January-29
Last tested date: 2024-May-05
Server code requires commit 472dd2 from 2024-Jan-27 (or newer) in order to compile properly, see Bug #952
A quick reference for Fedora 39
sudo dnf install flex g++ git libcurl libcurl-devel libtool make python3 python3-bsddb3 python3-devel sqlite
After compiling the server (sh autogen.sh && make && sudo make install) you will also need to run the following command - but make sure to change <username> to the correct login name for you setup:
sudo chown -R <username>.<username> /usr/games/crossfire/
Note: if you see an alert like this, “ chown: warning: '.' should be ':' ” then use this syntax:
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-January-12
Last tested date: 2024-May-05
Server code requires commit 472dd2 from 2024-Jan-27 or newer in order to compile properly, see Bug #952
A quick reference for Fedora 40
sudo dnf install flex g++ git libcurl libcurl-devel libtool make python3 python3-bsddb3 python3-devel sqlite
After compiling the server (sh autogen.sh && make && sudo make install) you will also need to run the following command - but make sure to change <username> to the correct login name for you setup:
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-April-24
Last tested date: 2024-April-24
The dependency and instructions for the listed versions of Linux Mint includes or applies to all the different flavors including:
A quick reference for Linux Mint 20 (Ulyana)
sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-devel sqlite3
Instructions creation date: 2024-January-29
Last tested date: 2024-May-05
A quick reference for Linux Mint 20.1 (Ulyssa)
sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-devel sqlite3
Instructions creation date: 2024-February-6
Last tested date: 2024-May-06
A quick reference for Linux Mint 20.2 (Uma)
sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-devel sqlite3
Instructions creation date: 2024-February-07
Last tested date: 2024-May-08
A quick reference for Linux Mint 20.3 (Una)
sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-devel sqlite3
Instructions creation date: 2024-February-07
Last tested date: 2024-May-08
A quick reference for Linux Mint 21 (Vanessa)
sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-dev sqlite3
Instructions creation date: 2024-February-07
Last tested date: 2024-May-08
A quick reference for Linux Mint 21.1 (Vera)
sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-dev sqlite3
Instructions creation date: 2024-February-08
Last tested date: 2024-May-08
A quick reference for Linux Mint 21.2 (Victoria)
sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-dev sqlite3
Instructions creation date: 2024-February-08
Last tested date: 2024-May-08
A quick reference for Linux Mint 21.3 (Virginia)
sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-dev sqlite3
Instructions creation date: 2024-May-12
Last tested date: 2024-May-12
A quick reference for Linux Mint 22 (Wilma)
sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-bsddb3 python3-dev sqlite3
Instructions creation date: 2024-July-26
Last tested date: 2024-July-26
A quick reference for Linux Mint Debian Edition
sudo apt-get install autoconf autotools-dev automake flex g++ gcc git libcurl4-openssl-dev libtool python3 python3-dev
It is important to run this command after the server compile process listed further down in the page.
Note: Linux Mint Debian Edition requires the directory permission change to use ':' instead of '.' like this,
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-February-9
Last tested date: 2024-February-9
A quick reference for Manjaro
sudo pacman -S base-devel git python-bsddb sqlite
It is important to run this command after the server compile process listed further down in the page.
Note: Manjaro requires the directory permission change to use ':' instead of '.' like this,
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-February-21
Last tested date: 2024-May-08
A quick reference for Manjaro 24 (Wynsdey):
sudo pacman -S base-devel git python-bsddb sqlite
It is important to run this command after the server compile process listed further down in the page.
Note: Manjaro requires the directory permission change to use ':' instead of '.' like this,
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-May-15
Last tested date: 2024-May-15
A quick reference for OpenSUSE Leap 15.5
sudo zypper install flex gcc-c++ git libtool python3-bsddb3 python3-devel sqlite3
It is important to run this command after the server compile process listed further down in the page.
Note: OpenSUSE requires the directory permission change to use ':' instead of '.' like this,
sudo chown -R <username>:users /usr/games/crossfire/
Instructions creation date: 2024-February-21
Last tested date: 2024-May-09
A quick reference for OpenSUSE Tumbleweed
sudo zypper install flex gcc-c++ git libtool python3-bsddb3 python3-devel sqlite3
It is important to run this command after the server compile process listed further down in the page.
Note: OpenSUSE requires the directory permission change to use ':' instead of '.' like this,
sudo chown -R <username>:users /usr/games/crossfire/
Instructions creation date: 2024-February-23
Last tested date: 2024-May-10
A quick reference for Pop!_OS 22.04 LTS
sudo apt-get install check flex git libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool python3-bsddb3 python3-dev sqlite3
Instructions creation date: 2024-February-26
Last tested date: 2024-May-10
A quick reference for Pop!_OS 22.04 LTS (NVIDIA)
sudo apt-get install check flex git libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libtool python3-bsddb3 python3-dev sqlite3
Instructions creation date: 2024-February-26
Last tested date: 2024-February-26
The dependency and instructions for the listed versions of Ubuntu includes or applies to all the different flavours including:
Ubuntu 20.04 no longer supports Python 2, so it is very important that Python 3 is installed.
Crossfire server relies heavily on Python for functions such as the message boards, post office, certain quests, gates & passwords, etc.
sudo apt-get install check autoconf flex git libsqlite3-0 libcurl4 libcurl4-openssl-dev python3-bsddb3 python3-dev sqlite3
Instructions creation date: n/a
Last tested date: 2024-May-11
A quick reference for Ubuntu 22.04 LTS (Jammy Jellyfish)
sudo apt-get install autoconf automake check flex g++ gcc git libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libsqlite3-0 libtool make python3-bsddb3 python3-dev sqlite3
Instructions creation date: 2023-October-11
Last tested date: 2024-May-12
A quick reference for Ubuntu 24.04 (Noble Numbat)
sudo apt-get install autoconf automake check flex g++ gcc git libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libsqlite3-0 libtool make python3-bsddb3 python3-dev sqlite3
It is important to run this command after the server compile process listed further down in the page.
Note: Ubuntu 24.04 (Noble Numbat) requires the directory permission change to use ':' instead of '.' like this,
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-April-21
Last tested date: 2024-April-26
A quick reference for Ubuntu 24.10 (Oracular Oriole)
sudo apt-get install autoconf automake check flex g++ gcc git libcurl4 libcurl4-openssl-dev libgd-dev libgd-tools libsqlite3-0 libtool make python3-bsddb3 python3-dev sqlite3
It is important to run this command after the server compile process listed further down in the page.
Note: Ubuntu 24.10 (Oracular Oriole) requires the directory permission change to use ':' instead of '.' like this,
sudo chown -R <username>:<username> /usr/games/crossfire/
Instructions creation date: 2024-November-23
Last tested date: 2024-November-23
This is the starting point and confirms you are located in your home directory
$ pwd /home/<username>
IMPORTANT - One should be consistent with what they check out; meaning use all trunk server & archetypes & maps or tags/1.75.0 server & archetypes & maps otherwise you run the risk of incompatibilities (broken maps, missing graphics, etc.)
The follow steps will download the necessary files to your computer, which will be used to compile (or build) the server.
$ git clone https://git.code.sf.net/p/crossfire/crossfire-arch crossfire-crossfire-arch $ git clone https://git.code.sf.net/p/crossfire/crossfire-maps crossfire-crossfire-maps $ git clone https://git.code.sf.net/p/crossfire/crossfire-server crossfire-crossfire-server
Here's the download URLs for Tag releases and is using the 1.75.0 release as an example
NOTE: The server download already contains the Archetypes, so that is why the URL for that file set is not listed
In the command line window or terminal, this confirms that you are still in your home directory
$ pwd /home/<username>
Now change directory (hence the cd) to the directory that contains the server files
$ cd crossfire-crossfire-server
This confirms that you are in the server directory
$ pwd /home/<username>/crossfire-crossfire-server
Now change directory again to the lib folder
$ cd lib
Make sure you are in the correct directory with the pwd command
$ pwd /home/<username>/crossfire-crossfire-server/lib
This step “links” two directories to each other which makes the compile process more automated
$ ln -s /home/<username>/crossfire-crossfire-maps/ maps
This step “links” two directories to each other which makes the compile process more automated and is used by the server once Crossfire server is up and running. This links the server to the map files which you downloaded earlier.
Next, create the necessary directory tree for the game files with this command:
$ sudo mkdir -p /usr/games/crossfire/share/crossfire $ sudo chown -R <username>.<username> /usr/games/crossfire/
What that does, is it creates a directory located here: /usr/games/crossfire/share/crossfire and changes the ownership of this directory to your user
Some distributions may require the chown command to run as this format instead
$ sudo chown -R <username>:<username> /usr/games/crossfire/
Now this step “links” two directories to each other which makes the compile process more automated
$ ln -s /home/<username>/crossfire-crossfire-maps /usr/games/crossfire/share/crossfire/maps
Double check again that you are in the correct directory
$ pwd /home/<username>/crossfire-crossfire-server/lib
This step “links” two directories to each other which makes the compile process more automated. This links the arch or archetype files to the server files which you downloaded earlier.
$ ln -s /home/<username>/crossfire-crossfire-arch ./arch
Make sure you have the maps and archetype directories properly linked by using this command:
$ ls -la
You will see multiple lines of output, but these are the two important ones you are looking for:
arch -> /home/<username>/crossfire-crossfire-arch/ maps -> /home/<username>/crossfire-crossfire-maps/
Go back another directory
$ cd ..
Double check that you are in the correct directory which is the server directory
$ pwd /home/<username>/crossfire-crossfire-server
Code update (~2007-Mar-30) changed the build process for the server; use the following command in the server root directory:
$ sh autogen.sh && make && sudo make install
autogen.sh script re-creates the configure (./configure) script while the rest of the command starts the compile (build) process. Pass the same options to autogen.sh as you would normally pass to ./configure since autogen.sh calls ./configure. This command requires both autoconf and automake to be installed.
(Otherwise do the following, and look below for optional arguments to autogen.sh) Now you are going to begin the compile process; choose one of the following:
$ ./configure && make && make install
Any missing dependencies, errors or similar problems during the compile process will be listed. Each should be addressed or resolved accordingly.
Optional: If you want to have more useful debugging information in case of crashes, set the CFLAGS environment variable to disable optimization (-O0) and enable debugging (-g): That is a uppercase letter O and a zero
$ CFLAGS="-O0 -g" ./configure && make && make install
Optional: For even more gdb debugging information, add -ggdb3 to the command
$ CFLAGS="-O0 -ggdb3" ./configure && make && make install
Optional: To disable the unit test or check when compiling the server, use ./configure –disable-check
$ ./configure --disable-check && make && make install
Optional: To enforce the unit test or check when compiling the server, use make -k check
$ ./configure && make -k check && make install
Optional: If you have modified any archetypes use:
$ cd lib && rm archetypes && make archetypes && cd .. && sh autogen.sh && make && sudo make install
More information at: Testing Archetypes
Once the server has been successfully built (aka compiled), you need to launch the Crossfire Server application
Double check that you are in the correct directory which is the server directory
$ pwd /home/<username>/crossfire-crossfire-server
Change directory the server directory
$ cd server
Your file directory path should look like this:
$ pwd /home/<username>/crossfire-crossfire-server/server
Just before launching it is worth while just to make sure all the permissions are correct for the server. If not, the server will not be able to write and characters will not be saved. To do so, re-run:
$ sudo chown -R <username>.<username> /usr/games/crossfire/
Or, in some distros require the chown command in this syntax:
$ sudo chown -R <username>:<username> /usr/games/crossfire/
Run this command to launch the server:
$ ./crossfire-server &
What that command will do is run the Crossfire server and return you back to bash or shell prompt
This is the same as running it from your install directory which is typically /usr/games/crossfire/:
$ /usr/games/crossfire/bin/crossfire-server &
Instructions for obtaining the latest source code for the server components of Archetypes, Maps, and Server using the git pull command.
It is recommended to update all components at the same time as some changes are dependent on each other. For instance, a new archetype or graphic is used by a map or server code change to fix a problem with an archetype or map.
Change (cd) in to the the Archetypes directory that was created in the earlier steps.
$ cd crossfire-crossfire-arch/
Make sure you are in the archetypes directory by using the pwd command
$ pwd /home/<username>/crossfire-crossfire-arch
Now run the git pull command:
$ git pull
If there are no updates, you will see the following:
$ git pull Already up to date.
If updates are available, they will be automatically downloaded for you.
Now change to the Maps directory - assuming you are still in the archetypes directory, run this extra command:
$ cd .. $ cd crossfire-crossfire-maps/
Make sure you are in the maps directory by using the pwd command
$ pwd /home/<username>/crossfire-crossfire-maps
Now run the git pull command:
$ git pull
If there are no updates, you will see the following:
$ git pull Already up to date.
If updates are available, they will be automatically downloaded for you.
Now change to the Server directory - assuming you are still in the maps directory, run this extra command:
$ cd .. $ cd crossfire-crossfire-server/
Make sure you are in the maps directory by using the pwd command
$ pwd /home/<username>/crossfire-crossfire-server
Now run the git pull command:
$ git pull
If there are no updates, you will see the following:
$ git pull Already up to date.
If updates are available, they will be automatically downloaded for you.
While still in the server directory, now run the compile instructions, listed above (hint: sh autogen.sh && make && sudo make install)
If crossfire-server is unable to locate the maps file it may be because the chown command didn't work. You may see an error like:
[EE] Cannot open /usr/games/crossfire/var/crossfire/clockdata for writing [EE] Couldn't read regions file from "/usr/games/crossfire/share/crossfire/maps/regions.reg". [EE] Please check that your maps are correctly installed.
A simple fix is to:
$ sudo chown -R <username>.<username> /usr/games/crossfire/
Note, great care should be taken in using chown -R as this will change all permissions in the parent directory (e.g. if you “ $ sudo chown -R <username>.<username> /” you will break your linux install's permissions completely)
A permission error such as this:
[EE] /usr/games/crossfire/var/crossfire/clockdata.tmp: Permission denied
Can be fixed by running this command again, be sure to correctly replace the <username> reference with the user who will be launching the server:
$ sudo chown -R <username>.<username> /usr/games/crossfire
A message about a missing accounts directory can be ignored because no player files or accounts have been created yet.
[II] Warning: Unable to open /usr/games/crossfire/var/crossfire/accounts [No such file or directory]
This might be a good time to setup crossloop .
Sometimes additional steps are required to compile the server after major development or code changes. Under most cicrcumstances, these steps are not needed. Bu they are being documented here just in case.
Listed below are some of thoes steps:
Change directories to crossfire-crossfire-server/lib
$ cd crossfire-crossfire-server/lib
Make sure you are in the correct directory with the pwd command
$ pwd /home/<username>/crossfire-crossfire-server/lib
Then run
$ make do-collect
Then change back to the crossfire-crossfire-server directory
$ cd ..
Make sure you are in the server directory
$ pwd /home/<username>/crossfire-crossfire-server
Repeat the steps listed under “COMPILE”
Make sure you are in the server directory
$ pwd /home/<username>/crossfire-crossfire-server
Run the autoreconf command
$ autoreconf -i
Repeat the steps listed under “COMPILE”
Make sure you are in the server directory
$ pwd /home/<username>/crossfire-crossfire-server
Run the clean command
$ sudo make clean
Repeat the steps listed under “COMPILE”
If you encounter check errors during the compile process:
make[6]: *** [Makefile:835: check_arch] Error 1
Note: numbers in the output may vary, but error format is similar
Note: this should only be encountered after a source code change from upstream or by changes made by you
To temporarily get around this issue, run the compile with –disable-check enabled.
Example:
sh autogen.sh --disable-check && make && sudo make install
- Warning this information may be out of date
- Needs updates to reference Git instead of Subversion (aka SVN)
To access the latest version of crossfire from sourceforge, a Windows compatible tool to access the source files is called tortoisesvn which is available here.
The interface is built into the windows environment, to access the repository create a new folder such as “crossfire files” and right click on this folder. You will see the following option menu now available:
Select “Repo-browser”. When asked, use this URL: https://svn.code.sf.net/p/crossfire/code
After a short time you should now see a window with the current directory structure of crossfire.
You can now start checking out directories you are interested in. Note: that the branches (trunk, stable etc) are within these directories so do not check-out from the root directory unless you want to download _everything_. To checkout a directory simply right click and select checkout:
and then choose where to save the downloaded files:
The following tools are used to compile the server:
common/loader.c
and random_maps/reader.c
from their respective .l. Syntax is: flex -oloader.c -i loader.l
, flex -oreader.c -i -P rm reader.l
respectively. The -P rm
seems to be required to not have duplicate symbol issuespthreadVC2.dll
, zlib1.dll
, libcurl.dll
libcurl.lib
and pthreadVC2.lib
(project settings → link → general → object/library modules)make_win32
directory, run the installwin32.bat
file. It will create required directoriesThe following tools are used to compile the client:
libpng.lib
to png.lib
). Don't ask why here, ask Glade/GTK+ project instead :)undef HAVE_SDL
, comment out lines, add files, and such). That may be fixed or not eventually.It may be possible to cross-compile Windows binaries from Unix.
Visit the server hosting page for information on setting up a server.