Technical

SERVER REQUIREMENTSWhat the game server needs to run

Our games run in the player's browser. Behind them, reached through our REST API, sits the game server: the component that holds the mathematics, the sessions and the wallet calls. Your own platform can be built in any technology; this page describes the machine that runs the game server.

Purchased games and source code

The game server is installed on your server, locked to your domain. This page is the specification of that server.

Rental packages

The requirements are the same. Where the game server runs is agreed as part of your commercial terms.

Your platform

Needs none of this. It talks to the game server through the API, in any language. The integration is documented at docs.casinowebscripts.com.

Step one

Basic Requirements

Essential for every installation. Recommended hosting: CloudWays or FastComet, where all of this is pre-configured.

Basic

Getting Started

Domain, server, a support ticket and CloudFlare: ready in about 30 minutes

Read more
Mandatory

Operating System

Linux with Bash and the standard command-line tools

Read more
Mandatory

Web Services

Apache 2.4+ or LiteSpeed, PHP 8.3, MySQL 8, Memcached

Read more
Mandatory

Additional Requirements

SSL certificate, phpMyAdmin or cPanel, SFTP access, disk space

Read more
Basic

PHP Extensions

13 required extensions, including the SourceGuardian loader

Read more
Basic

Server Configuration

PHP settings, MySQL mode, .htaccess support, session cookies

Read more
Step two

Advanced Requirements

For custom server setups and self-managed hosting (AWS, DigitalOcean and the like). A custom setup must cover both the Basic and the Advanced requirements.

Advanced

Environment Variables

HTTPS, DOCUMENT_ROOT and HTTP_HOST must be set correctly

Read more
Advanced

File Permissions

Write access for the web server to the runtime directories

Read more

Quick checklist

  • Basic A Linux server with SSH access
  • Basic Apache 2.4+ with mod_rewrite (or LiteSpeed)
  • Basic PHP 8.3 installed
  • Basic Every listed PHP extension enabled, SourceGuardian loader included
  • Basic A MySQL 8 database with full privileges
  • Basic Memcached running on port 11211
  • Basic An SSL certificate installed
  • Basic 30 to 60 GB of disk space available
  • Advanced The environment variables set correctly
  • Advanced The file permissions configured
The player's side

Player Device Requirements

The games are HTML5. Nothing is installed on the player's device; this is what the browser needs.

Desktop

Operating system: Windows, Linux or macOS.

Minimum hardware:

  • 2 GHz CPU with at least 2 cores
  • 6 GB RAM
  • A graphics card with at least 2 GB (2016 or newer)

Recommended hardware:

  • 3 GHz CPU with at least 2 cores
  • 8 GB RAM
  • A graphics card with at least 2 GB (2016 or newer)

Recommended browsers: Google Chrome and Firefox.

Google Chrome Firefox Safari Opera

Mobile

Operating system: Android or iOS, the latest version or at most 3 years old.

Recommended browsers: Safari on iOS and Google Chrome on Android.

Every game is built mobile-first and plays in portrait and landscape. No app store, no download: the player opens a link.

Sizing

Game Server Performance

The response time of the games is the most important asset of any online gaming business. Players do not tolerate waiting "for the game to think". When we designed the game server and the games, the goal was to make them as fast and efficient as possible: advanced caching, efficient queries and optimised code.

The response time is influenced by the number of players playing at the same time and by the power of the server hardware. Since the code is optimised, it is the server's job to have enough resources to keep up with the requests. Below are server recommendations by the maximum number of players you expect. All of them come from real tests that we performed on our software installed on various servers; CWSAPISOFT.com is our parent studio's domain used exclusively for server testing.

Load tests

The tests below show what server to order for the number of players you expect.

Server typeRAM
CPU cores
Concurrent usersAverage response timePeak concurrent usersResponse time at peakReplayServer cost / monthCost per 100 users*Potential profit
VPS 8GB
4 cores
100 0.484s 192 1.112s View test replay $100/mo
FastComet.com
$100/mo $1,658,880/mo
DS 4GB
2 cores
150 0.248s 299 1.110s View test replay $41/mo
CloudWays.com
$27/mo $2,583,360/mo
DS 8GB
4 cores
200 0.404s 400 1.509s View test replay $200/mo
CloudWays.com
$100/mo $3,456,000/mo
DS 16GB
8 cores
320 0.214s 522 0.727s View test replay $320/mo
CloudWays.com
$100/mo $4,510,080/mo
DS 16GB
8 cores
330 0.293s 635 0.727s View test replay $320/mo
CloudWays.com
$97/mo $5,486,400/mo
DS 32GB
16 cores
500 0.247s 823 0.682s View test replay $500/mo
CloudWays.com
$100/mo $7,110,720/mo
DS 32GB
16 cores
700 0.457s 900 1.688s View test replay $500/mo
CloudWays.com
$71/mo $7,776,000/mo
DS 64GB
32 cores
1,000 0.373s 2,000 0.479s View test replay $847/mo
CloudWays.com
$85/mo $17,280,000/mo
DS 128GB
64 cores
2,500 0.494s 4,000 0.580s View test replay $1,680/mo
CloudWays.com
$67/mo $34,560,000/mo
DS 128GB
64 cores
3,000 0.665s 5,000 0.815s View test replay $1,680/mo
CloudWays.com
$56/mo $43,200,000/mo

Server type: VPS = virtual private server, DS = dedicated server. Hosting prices are the providers' list prices at the time of each test.

Conclusion

The game server scales vertically, by adding CPU and RAM. Since it runs on PHP-FPM, the server API adjusts the number of workers by itself, so you do not need to tune the server configuration. The ratio between RAM, users and server cost stays almost constant: for every $1 spent you can serve about one more concurrent user, so $100 of server serves about 100 concurrent users. As the server grows, RAM and CPU get cheaper per user: 500 users on 16 GB cost about $1 per user, while 3,000 users on 128 GB cost about $0.57 per user.

Important: the tests were performed with loader.io. We define "concurrent users" as players who click SPIN in the exact same second, so 1,000 concurrent users means 1,000 players clicking SPIN every second. In most games the animations run for one or two seconds after the click, so only at peak time would 1,000 players produce 1,000 concurrent requests.

*Potential profit a month is estimated with a 2% house edge, players betting $1 a spin and clicking SPIN once every 3 seconds, for only 12 hours a day; the low-traffic hours are excluded completely.

Which host

Recommended hosting companies: CloudWays if you need someone to help with managing and monitoring the server, otherwise AWS if you have a developer who manages and monitors it.

FastCometvsCloudWays
Uses cPanel, which makes server handling easier for developers, but it takes more resources and slows the server by around 15 to 20%.No cPanel, but a management panel of its own. The servers are more efficient, with fewer tools that may not be necessary.
Support helps with all sorts of things: investigations, updates, monitoring, problems.Support installs extensions and services for an advanced support fee of about $100 a month.
Scales only up to 128 GB and takes several hours.Scales up to 384 GB and takes about 10 minutes.

Gaming statistics

A top social casino has around 6 million users a month, according to statistics gathered by statista.com. According to casino.org, a player loses around $38 on average at slot games. A player betting $1 a round would need at least 800 rounds on a 95% RTP to lose $38.

Careful monitoring of the response time, the uptime and the server resources keeps the players' experience pleasant and tells you when it is time to upgrade the hardware. We recommend that the hosting company monitors the server during the first weeks of activity, to make sure that no memory or connection limit on their side slows the games down. Depending on the number of players, you may need more RAM, more CPUs, or larger values for the Apache "workers" and "children" settings.

Not sure what to order?

Tell us how many players you expect and we will tell you which server to get, and give you the text for your host's support ticket.

Contact Us API Documentation

Getting Started

If the game server will run on a machine you provide, you can be up and running in about 30 minutes by following these steps:

~10 minutes

Step 1: Order a web domain

Order a web domain, or use an existing domain or subdomain. It will be dedicated to the game server.

~20 minutes

Step 2: Order a dedicated server

Rent a server from a secure datacenter, so that power loss or internet downtime at an office cannot take the games down. Choose a location close to where most of your players are: if you target players from the USA, pick a USA-based server.

We recommend a fully managed server, so that the hosting company handles any tweaking or configuration change through a simple support ticket.

Recommended: CloudWays, managed hosting with fast scalability.
Alternative: FastComet, which includes cPanel but requires a licence or legal verification before approval.
If you want to use AWS or your own managed server, also read the Advanced section of this page.

~1 minute

Step 3: Send a support ticket to your host

Once the server is ordered, send the hosting company a support ticket requesting the required configuration. We give you the exact text to include in that ticket: copy and paste it.

~10 minutes

Step 4: Set up CloudFlare

Create a free or paid CloudFlare account and add your domain. CloudFlare provides:

  • Security: DDoS protection and a firewall
  • SSL certificate: free HTTPS for your domain
  • Performance: static content caching for faster loads
  • DNS management: easy domain configuration

Once the account exists, we can help you with the rest of the configuration.

If you work with a hosting company other than the recommended ones, make sure the Basic requirements are covered. If you manage the server yourself, also check the Advanced requirements.

Operating System Requirements

Required

  • A Linux distribution (Ubuntu, CentOS, Debian or similar)
  • The Bash shell at /bin/bash or /usr/bin/env bash, needed for the setup and the updates

Required OS tools

  • unzip: archive extraction
  • mkdir, cp, mv, rm: file operations
  • chmod, chown: permission management
  • cat: file reading
  • All of the above are used by our setup and by the periodical updates

SSH/SFTP access

  • The user must have write permission on the application directory
  • The ability to execute scripts
  • SFTP access for file uploads
  • All of the above are used by our setup and by the periodical updates
Recommended hosting: CloudWays and FastComet have all of these requirements pre-configured. You get a hosting package from them, paste them the message we give you, and you are set.

Web Services Requirements

Apache web server

  • Version 2.4 or higher (or LiteSpeed Web Server)
  • Required modules: mod_rewrite, mod_deflate
Important: Apache MPM Prefork must be used, for thread safety. Do not use MPM Worker.

PHP

  • Version: PHP 8.3
  • Server API: PHP-FPM (FastCGI) or LSAPI (recommended)

MySQL database

  • Version: MySQL 8
  • The MySQL user you provide must have ALL PRIVILEGES on the database

Additional server services

  • The Memcached daemon running on port 11211, on the same server as the HTTP server
  • An SSL certificate for HTTPS (if not using CloudFlare)
Recommended hosting: CloudWays and FastComet include all of these services pre-installed and optimised. You get a hosting package from them, paste them the message we give you, and you are set.

PHP Extensions Required

All extensions are mandatory. A missing one causes improper functionality.

Core extensions

  • mysqli: MySQL database connectivity
  • GD: image processing
  • XML: XML parsing
  • cURL: HTTP requests
  • ZIP: archive handling
  • OpenSSL: encryption and SSL
  • GMP: math operations
  • OpCache: performance

String and encoding

Caching

Code protection

Note: these extensions are installed by your hosting provider. Verify the list with them.

Server Configuration

PHP configuration

  • short_open_tag = On

MySQL configuration

Critical: MySQL strict mode must be turned OFF.
  • Set sql_mode="" (an empty string)

.htaccess support

Important: the web server must support .htaccess files.
  • AllowOverride All must be enabled for the document root
  • .htaccess files must be uploadable through the web or SFTP
  • ModSecurity, if enabled, must not strip .htaccess content

php.ini

Important: your php.ini or user.ini must carry these flags.
  • session.cookie_secure = 1
  • session.cookie_httponly = 1
  • session.cookie_samesite = None
  • session.cookie_path = /
  • session.cookie_domain = .YOUR_WEB_DOMAIN.com
Note: these settings are typically pre-configured by the recommended hosting providers. Contact your hosting support if you need to adjust them.

Additional Requirements

Third party

  • Optional: a CloudFlare paid plan for DNS management, a firewall, static file caching and SSL

SSL certificate (mandatory)

  • A valid SSL certificate installed for your domain
  • It can be provided through CloudFlare or installed directly
  • Required for secure HTTPS connections

Database management (mandatory)

  • phpMyAdmin or cPanel access
  • Required for the database import and management

File access (mandatory)

  • SFTP/SSH access with write permissions
  • The ability to upload and modify files
  • Permission to execute .sh scripts

Disk space (mandatory)

  • 30 GB minimum for installations with fewer than 100 games
  • 60 GB recommended for installations with 100+ games
  • 100 GB recommended for installations with large traffic (more than 1 million transactions a day)
Recommended hosting: CloudWays and FastComet include SSL certificates (Let's Encrypt), phpMyAdmin or cPanel, and SFTP access by default.
CloudFlare (not CloudWays) is recommended for the SSL certificate and DNS management.

Server Environment Variables

Critical: these issues cause 90% of the "white screen" and redirect-loop problems.

SSL/HTTPS configuration

  • The SSL certificate must be properly installed
  • $_SERVER['HTTPS'] must be set to 'on' or '1'
  • Test with: <?php echo $_SERVER['HTTPS'] ?? 'NOT SET'; ?>
If SSL is installed but $_SERVER['HTTPS'] is not set, check the Apache or proxy configuration.

Document root configuration

  • $_SERVER['DOCUMENT_ROOT'] must point to /path/to/public_html/
  • Common mistake: a doubled path such as /public_html/public_html/
  • Test with: <?php echo $_SERVER['DOCUMENT_ROOT']; ?>
# Correct:
/var/www/html/public_html
/home/username/public_html

# Wrong:
/var/www/html/public_html/public_html

Host variables

  • $_SERVER['HTTP_HOST'] must be passed by the web server
  • $_SERVER['SERVER_NAME'] must be set
  • Both are required for the www / non-www redirects; we handle the redirects themselves
# Test these variables:
<?php
echo 'HTTP_HOST: ' . ($_SERVER['HTTP_HOST'] ?? 'NOT SET');
echo '<br>SERVER_NAME: ' . ($_SERVER['SERVER_NAME'] ?? 'NOT SET');
?>

WWW domain handling

  • Both domain.com and www.domain.com must work
  • The server must honour the .htaccess rewrite rules for the redirects; we handle the redirects themselves
  • Requires HTTP_HOST and SERVER_NAME to be set

SourceGuardian hostname check

  • The SourceGuardian licence must match your primary domain
  • The domain opened in the browser must match the licensed domain
Note: on a "license validation" error, make sure the HTTP_HOST variable matches the licensed domain. Contact your hosting provider for hostname configuration issues.

Quick diagnostic script

Create test-env.php and upload it to the server root:

<?php
echo '<h3>Server Environment Check</h3>';
echo 'DOCUMENT_ROOT: ' . ($_SERVER['DOCUMENT_ROOT'] ?? 'NOT SET') . '<br>';
echo 'HTTPS: ' . ($_SERVER['HTTPS'] ?? 'NOT SET') . '<br>';
echo 'HTTP_HOST: ' . ($_SERVER['HTTP_HOST'] ?? 'NOT SET') . '<br>';
echo 'SERVER_NAME: ' . ($_SERVER['SERVER_NAME'] ?? 'NOT SET') . '<br>';
echo 'Real Path: ' . realpath(__FILE__) . '<br>';
echo 'Hostname: ' . gethostname() . '<br>';
?>

Open it in the browser: https://yourdomain.com/test-env.php

Every value must show real data, never "NOT SET". Delete the file afterwards.

File System Permissions

Critical: incorrect permissions are the number one cause of installation failures.

Web server write access required on

  • /plugins_default/encryption/: key storage
  • /uploads/: file uploads
  • /cache/: cache files
  • /logs/: log files
  • Any directory where files are created at runtime

Recommended setup

Add the web server user to the application owner's group:

sudo usermod -a -G [app_owner] [web_server_user]
# Example: sudo usermod -a -G cws apache

Then restart the web server:

sudo systemctl restart httpd
# or
sudo systemctl restart apache2

Set the directory permissions:

chmod 775 /path/to/directories

Common web server users

  • apache: Apache on RHEL/CentOS
  • www-data: Apache/Nginx on Debian/Ubuntu
  • nginx: Nginx on some systems
  • nobody: some shared hosting
Important: the files must NOT be owned by root. Root ownership causes file-reading errors and permission issues. The files must be owned by the web server user or the application user (for example www-data, apache, or your cPanel user).

Verify the permissions

Check which user PHP runs as:

<?php echo posix_getpwuid(posix_geteuid())['name']; ?>

Or from the command line:

ps aux | grep -E 'apache|nginx|httpd'
G4T Assistant Typically replies instantly
Hi! I'm the Games4Titans assistant. Ask me about our games, pricing, integration, or our special offer for new operators.