Installation

Getting started with Lua on Beans is easy. Since it's built on Redbean, there are no complex dependencies to manage.

Prerequisites

computer Operating System

A Unix-like operating system (Linux, macOS, BSD)

code Node.js & npm

Node.js and npm installed for the beans-cli tool

Step-by-Step Setup

1

Install luaonbeans-cli

Install the Lua on Beans CLI tool globally via npm:

$ npm i -g luaonbeans-cli
info

This will install the beans command globally, making it available from anywhere in your terminal.

2

Create a New Project

Use the beans CLI to create a new application:

$ beans new demoapp
$ cd demoapp
$ npm i

This will create a new directory demoapp with the complete project structure including:

  • folder app/ - Controllers, models, and views
  • folder config/ - Routes and configuration
  • folder public/ - Static assets
3

Start the Development Server

Start the development server with live reload:

$ beans dev
check_circle

Success!

Visit http://localhost:8080 in your browser to see your new application running!

tips_and_updates

The dev server runs on port 8080 with a WebSocket on port 8081 for live reload functionality.

lightbulb

Next Steps

Now that you have Lua on Beans installed, learn how to: