Skip to content
The current state of the server.
C JavaScript C++ Python Makefile M4 Other
Branch: master
Clone or download
Lexxie9952 Empire Tab + bugfix...
1. mapctrl.js.208 - else if was nested too deep, may have caused right-click drag failure
Latest commit 1298d6e Oct 17, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
blender Update 3d models. Update Three.js. Minor update to Hall of Fame. Dec 7, 2017
config Fix: Check auth kind in proxy Dec 24, 2018
docker-old Move unfunctional docker scripts to a backup folder. Change the readm… Jul 10, 2019
freeciv-earth Fix executable flags on files Apr 10, 2019
freeciv-proxy Revert "Remove google auth" Aug 10, 2019
freeciv-web Empire Tab + bugfix... Oct 17, 2019
freeciv Fixes to allow Gamemaster setup of Team Games Oct 12, 2019
music Fix executable flags on files Apr 10, 2019
nginx Deny outside access to local metaserver Apr 10, 2019
pbem Fix executable flags on files Apr 10, 2019
publite2 Prevent overwriting supercows.txt after git pull Oct 2, 2019
rulesets/mpplus Update script.lua Apr 10, 2019
scripts Fix: run apt-get in noninteractive mode Aug 28, 2019
tests Communicate game type through the URL Sep 29, 2018
.directory Add additional server files Apr 10, 2019
.gitattributes Fix line endings Aug 20, 2018
.gitignore Add supercows.txt to gitignore ONE MORE TIME! Oct 8, 2019
.mailmap Merge the git identities of Andreas Røsdal Apr 12, 2015
.travis.yml Update travis dist to xenial Dec 4, 2018 Dynamic setup of "longturn" games Sep 30, 2018
LICENSE.txt Fix broken link. Apr 1, 2017 Create Oct 10, 2019 Dynamic setup of "longturn" games Sep 30, 2018 Move unfunctional docker scripts to a backup folder. Change the readm… Jul 10, 2019 Rename TODO. Apr 10, 2019
Vagrantfile Improve vagrant performance by using NFS on Linux and Mac and swapsac… Apr 10, 2019
requirements.txt Add python requirements files Feb 24, 2019


Build Status Code Quality: Javascript Total Alerts

Freeciv-web is an open-source turn-based strategy game. It can be played in any HTML5 capable web-browser and features in-depth game-play and a wide variety of game modes and options. Your goal is to build cities, collect resources, organize your government, and build an army, with the ultimate goal of creating the best civilization. You can play online against other players (multiplayer) or play by yourself against the computer. There is both a HTML5 2D version with isometric graphics and a 3D WebGL version of Freeciv-web.

Freeciv-web is free and open source software. The Freeciv C server is released under the GNU General Public License, while the Freeciv-web client is released under the GNU Affero General Public License. See License for the full license document.

Currently known servers based on Freeciv-web:

Freeciv WebGL 3D: Freeciv-web

Freeciv-web HTML5 version: Freeciv-web


Freeciv-Web consists of these components:

  • Freeciv-web - a Java web application for the Freeciv-web client. This application is a Java web application which make up the application viewed in each user's web browser. The Metaserver is also a part of this module. Implemented in Javascript, Java, JSP, HTML and CSS. Built with maven and runs on Tomcat 8 and nginx.

  • Freeciv - the Freeciv C server, which is checked out from the official Git repository, and patched to work with a WebSocket/JSON protocol. Implemented in C.

  • Freeciv-proxy - a WebSocket proxy which allows WebSocket clients in Freeciv-web to send socket requests to Freeciv servers. WebSocket requests are sent from Javascript in Freeciv-web to nginx, which then proxies the WebSocket messages to freeciv-proxy, which finally sends Freeciv socket requests to the Freeciv servers. Implemented in Python.

  • Publite2 - a process launcher for Freeciv C servers, which manages multiple Freeciv server processes and checks capacity through the Metaserver. Implemented in Python.

  • pbem is play-by-email support.

  • freeciv-earth is code to generate Freeciv savegames from a map captured from mapbox.

Freeciv WebGL

Freeciv WebGL is the 3D version, which uses the Three.js 3D engine. More info about the WebGL 3D version can be found for developers and 3D artists. Developer: Andreas Røsdal @andreasrosdal

Running Freeciv-web on your computer

The recommended and probably easiest way is to use Vagrant on VirtualBox.

Whatever the method you choose, you'll have to check out Freeciv-web to a directory on your computer, by installing Git and running this command:

 git clone --depth=10

You may also want to change some parameters before installing, although it's not needed in most cases. If you have special requirements, have a look at config.dist, copy it without the .dist extension and edit to your liking.

⚠️ Notice for Windows users

Please keep in mind that the files are to be used in a Unix-like system (some Ubuntu version with the provided Vagrant file). Line endings for text files are different in Windows, and some editors "correct" them, making the files unusable in the VM. There's some provision to recode the main configuration files when installing, but not afterwards. If you touch shared files after installation, please use an editor that respect Unix line endings or transform them with a utility like dos2unix after saving them.

Running Freeciv-web with Vagrant on VirtualBox

Freeciv-web can be setup using Vagrant on VirtualBox to quickly create a local developer image running Freeciv-web on latest Ubuntu on your host operating system such as Windows, OSX or Linux. This is the recommended way to build Freeciv-web on your computer.

  1. Install VirtualBox: - Install manually on Windows, and with the following command on Linux:
sudo apt-get install virtualbox
  1. Install Vagrant: - Install manually on Windows , and with the following command on Linux:
sudo apt-get install vagrant
  1. Run Vagrant with the following commands in your Freeciv-web directory:
vagrant up

This will build, compile, install and run Freeciv-web on the virtual server image. Wait for the installation process to complete, watching for any error messages in the logs.

NOTE: Vagrant is now configured to run with NFS on Linux and Mac, which speeds it up by 10-100 times. This should run out of the box for Mac OS X 10.5+ as well as Linux. If you are having problems on Linux, you might need to execute the following commands:

sudo apt-get install nfs-kernel-server nfs-common portmap

on Debian based systems or their equivalents.

  1. Test Freeciv-web by pointing your browser to http://localhost if you run Windows or http://localhost:8080 if you run Linux or macOS.

To log in to your Vagrant server, run the command:

vagrant ssh

The Vagrant guest machine will mount the Freeciv-web source repository in the /vagrant directory. Note that running Freeciv-web using Vagrant requires about 4Gb of memory and 3 Gb of harddisk space.

System Requirements for manual install

Install this software if you are not running Freeciv-web with Vagrant:

When in a tested system, you may run scripts/install/ and it will fetch and configure what's needed.

Start and stop Freeciv-web with the following commands:

All software components in Freeciv-web will log to the /logs sub-directory of the Freeciv-web installation.

Freeciv-Web continuous integration on Travis CI

Freeciv-Web is built on Travis CI on every commit. This is the current build status: Build Status

Freeciv-web has CasperJS tests which are run by Travis CI on every commit, and by Vagrant when creating a new image. The tests can be found in tests/freeciv-web-tests.js. Please make sure that patches and commits for Freeciv-web don't break the CasperJS tests. Thanks!

Developers interested in Freeciv-web

If you want to contibute to Freeciv-web, see the issues on GibHub and the TODO file for some tasks you can work on. Pull requests on Github is welcome!

Contributors to Freeciv-web

Andreas Røsdal @andreasrosdal
Marko Lindqvist @cazfi
Sveinung Kvilhaugsvik @kvilhaugsvik
Gerik Bonaert @adaxi
Lmoureaux @lmoureaux
Máximo Castañeda @lonemadmax
and the project!

You can’t perform that action at this time.