Skip to content
lantern.

Your first website.

Create, edit and preview a page on a Minecraft computer. No modem is needed for the local preview.

On this page

1. Install Lantern.

Run this in the CraftOS shell. HTTP must be enabled and lantern.thultz.dev allowed by your Minecraft server. Choose Browser + hosting or Hosting tools. Both include the renderer needed for local previews.

CraftOS shell
wget run https://lantern.thultz.dev/downloads/lantern.lua

2. Create a local site.

The site lives at /lantern-data/sites/my-first-site. You can also start with lantern edit. Site names on your computer do not automatically reserve the same address on the Hub.

  1. 1Choose Create a site from a template.
  2. 2Enter my-first-site (2–40 lowercase letters, digits or hyphens; start with a letter or digit).
  3. 3Choose personal. You will arrive at the site management menu.
CraftOS shell
lantern host

3. Edit the page.

Choose Edit page JSON. Accept /index.json. Replace the file with this page, then save and exit the CraftOS editor. Ctrl opens its menu; choose Save, then Exit.

index.json
{  "version": 1,  "title": "My first site",  "children": [    {      "type": "heading",      "text": "Hello, other worlds!"    },    {      "type": "paragraph",      "text": "I made this page with Lantern."    }  ]}

4. Validate and preview.

  1. 1Choose Validate site. It checks JSON pages, loads app.lua if present, and tries the home-page GET.
  2. 2Choose Preview locally. You should see your heading and paragraph.
  3. 3Use the browser menu to Quit and return to the editor.

5. Try your first Lua page.

Choose Edit server Lua. For a static template, Lantern creates a working starter app.lua. Replace its content with the code below. Save, validate, then preview. You should see “testing”.

When app.lua returns a page, that response takes precedence over index.json. To return to a static-only site, remove app.lua after saving a backup, or make the handler return nil for GET paths.

app.lua
return function(ctx)  local P = ctx.page  return {kind="page", page=P.document("My first site", {    P.heading{text="Hello, other worlds!"},    P.paragraph{text="testing"},    P.link{text="Explore the Hub", href="hub://directory/"}  })}end

6. Share it.

You now have a working local site. Choose one of the hosting paths next.

Found a mismatch? Include the exact error, runtime version and a small example with secrets removed.