Mako Server

Mako Server provides a super compact and efficient Lua web framework and non-blocking asynchronous sockets in a tiny ready to run application server package. The server includes everything you need: integrated database, SMTP, HTTP client/server, IoT protocols such as MQTT, industrial protocols such as Modbus, and more. The Mako Server is ideal for memory constrained embedded Linux systems.

Lua Programming Language

Mako Server is the easiest to use web server for Lua development, Internet of Things, and multiplayer game server hosting.

Why Lua?

  • Small
  • Fast
  • Easy to learn
  • Powerful

Lua is a powerful, efficient, lightweight, programming language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description. Learning Lua is easy with the Mako Server's step by step interactive examples.

The Mako Server extends Lua and provides Lua Server Pages, asynchronous sockets, WebSockets, and many additional features.

Lua Logo

Lua Server Pages

Lua Server Pages (LSP) is based on the Lua programming language and makes developing web applications extremely fast, simple, safe, and fun. Notably, LSP isn't limited to the development of web applications, but can also be used to provide high-level socket APIs that make developing secure socket applications very easy. Getting started with LSP is especially easy if you have prior experience with similar application server scripting technologies such as PHP.

The Number of the Day Example

<html> <body> <h1> The Number of the Day is <?lsp=ba.rnd(1, 10)?> </h1> </body> </html>

The Mako Server is licensed similar to freeware for small companies. See license at the end of this webpage for details.

Getting Started

Download Server & Tutorials:

Follow the instructions outlined in the Getting Started with the Mako Server guide.


Online Interactive Lua Tutorials:

An online VPS running the tutorials is also available. You may use the online interactive tutorials by navigating to:
http://embedded-app-server.info.

Additional Tutorials:

We provide an extensive list of written tutorials, which covers everything from Lua development to hosting IoT servers.

The Mako Server tutorials are optionally available as a Docker image.

docker run -i -p 80:80 -p 443:443 -p 23:23 --name lua-server-tutorial rtld/lua-server-tutorial


Mako Server vs. other Lua Frameworks

Virtually all other Lua web frameworks are designed as web server plugins and require that you assemble a complete setup. These frameworks have a tendency to be big so if size and speed matters, Mako Server may be a better choice (see below). The Mako Server is based on the Barracuda App Server Library which is optimized for resource constrained systems. A copy of the Barracuda App Server Library's extensive documentation can be found online and the Mako Specific features are also included in the online documentation.


Hosting Online Web Sites with the Mako Server

Although the Mako Server is great for small embedded Linux devices, the Mako Server is also a great fit for hosting online web sites on the cheap. With Mako Server you can host anything from static HTML files to advanced server side and database driven web sites.

Why use the Mako Server for hosting online web sites?

Take a look at the following screenshot from our Uptime Robot's dashboard. The screenshot shows a list of Mako Server powered web sites running on Virtual Private Servers (VPS).

100% server uptime

We use several low cost VPS service providers and not all provide 100% uptime, but pay attention to NODE 1 to 4. These four nodes are part of the Mako Server's IoT SMQ cluster demo. Note that the nodes all have 100% uptime, and they run on Virtual Private Servers that cost less than $12 a year. Some VPS providers provide rock solid low cost Virtual Private Servers, but they are usually resource limited, meaning that standard application servers cannot be used. However, the Mako Server is super light on resources and has no problem running on a resource constrained VPS. See the online Mako Server installation tutorial, Setting up a low cost IoT Broker, on how to install the Mako Server on a VPS. The online Mako Server installation includes a web based IDE and is not limited to running the SMQ broker example. Simply delete the SMQ broker example using the Web IDE if you want to create your own custom application.

Game Server Hosting

Many games are designed in Lua and if you already have Lua experience, Mako Server makes the backend hosting for your game easy.

The Mako Server includes a super efficient publish/subscribe protocol called SMQ that is ideal for online gaming infrastructure. The SMQ broker is an integral part of the server. The broker can be extended using the public API, thus making it easy to interface your own messaging infrastructure and Lua server logic with database services.

The SMQ protocol enables clustering and scaling. See the SMQ cluster demo for more information. SMQ includes ready to use stacks for Java/Android, JavaScript, and C/C++.

Internet Of Things (IoT) Server

The Mako Server's included SMQ protocol is ideal for IoT. The following video shows how a device can be controlled from a web browser in real time. The Mako Server acts as a broker for the communication between the browser and the device.

How to setup your own secure IoT cloud server ESP8266 Arduino WiFi IoT Device to Cloud Setup

Multiplayer Game Server & IoT:

See the IoT page for more information on the SMQ protocol.


Mako Server Benchmarking -- Speed Test

The Mako Server is extremely fast at dynamic content generation. We compared the Mako Server delivering dynamically generated Lua Server Pages to the Apache Server delivering static content. We were able to generate dynamic content much faster than Apache could deliver static content.

Two minute speed test on a generation 1 Raspberry Pi (700MHz ARMv6):

  • Apache: 26,624 static files
  • Mako Server: 45,577 dynamic pages
Benchmarking Apache and Mako Server

The benchmarking should have been performed with other dynamic content frameworks such as PHP, but we were unable to find any reliable benchmarking data. In any event, PHP is slower than static content when run in an Apache server.

License and Internals


The Mako Server is a commercial product, but is free for small companies. See Real Time Logic's license page for details.


The Internals

The Mako Server consists of one executable file that includes all of the following four components:
  1. The Mako Server startup code
  2. The Barracuda Application Server library
  3. The SQLite database
  4. Lua Server Pages which enable Lua script code to access lower level C functionality

Figure 1: Mako Server running 3 Lua web applications

Mako Server Block Diagram

Mako Server vs. Barracuda App Server

The Mako Server and the Barracuda App Server (BAS) are the same, but as the above figure shows, BAS is a C source code library and not a standalone product. Just like the ANSI C library cannot be used before you at least create a "Hello World" program, so is the case with BAS. The Mako Server is the Barracuda App Server's "Hello World" equivalent. The Mako Server assembles BAS, the SQLite database, and additional features into a configurable application server product. BAS is a commercial product that is used by many industrial companies for web enablement of equipment or for connecting equipment to various cloud services. The BAS source code may be purchased from Real Time Logic and may be used with many more operating systems than the Mako Server, including RTOS. The Mako Server is included as a component in the BAS SDK. See the Barracuda App Server page for details.