Getting Started with Open Mercato
Run Open Mercato on your computer, sign in to the admin panel and add a page in your own module.
Open Mercato 0.7.0 · local development · macOS / Linux / WSL2
Prepare your tools
Install Node.js 24.x and Docker with Compose. Start Docker Desktop if you use it. On Windows, run these commands in a WSL2 terminal with Docker integration enabled.
node --version
docker compose version
corepack enableNode should report v24.x.x and Compose should print its version. corepack enable makes Yarn available; the project selects version 4.17.1.
Create the application
Run these commands in the directory where you keep your projects. They create a new folder named mercato-demo.
npx create-mercato-app@0.7.0 \
mercato-demo \
--preset classic \
--agents none \
--no-init-git
cd mercato-demo
yarn --versionclassic selects the standard modules. --agents none skips AI assistant configuration; --no-init-git skips Git repository initialization. If npm asks to download the package, answer y.
You are now inside the application directory. yarn --version should print 4.17.1. Run all remaining commands here.
Start the database and services
Copy the local configuration and start the services from the included Compose file. PostgreSQL stores data, Redis supports caching and queues, and Meilisearch provides search.
cp .env.example .env
docker compose up -d
docker compose psIn a new project, the settings in .env match these containers. The database connection is:
DATABASE_URL=postgres://postgres:postgres@localhost:5432/open-mercatoWait until docker compose ps shows three running services and PostgreSQL is healthy. These settings include example passwords for development on your own computer.
Start the application and sign in
yarn install
yarn setupyarn install downloads dependencies. yarn setup generates application files, applies database migrations, creates initial data and starts the server. Leave this terminal running.
Open localhost:3000/backend. For this local setup, sign in with superadmin@acme.com and password secret. You should reach the application dashboard.
Add your own page
Stop the server with Ctrl+C. In your editor, create the following three files and their directories. The hello module adds a simple page for signed-in users.
export const metadata = {
name: 'hello',
title: 'Hello',
version: '0.1.0',
}
export const metadata = {
requireAuth: true,
pageTitle: 'Hello',
}
import { Page, PageHeader, PageBody } from '@open-mercato/ui/backend/Page'
export default function HelloPage() {
return (
<Page>
<PageHeader title="Hello, Mercato" />
<PageBody>
<p>My first Open Mercato page.</p>
</PageBody>
</Page>
)
}
In src/modules.ts, add this entry inside the enabledModules array, alongside the existing modules:
{ id: 'hello', from: '@app' },Regenerate the module registry and restart the application:
yarn generate
yarn devVisit localhost:3000/backend/hello. You should see Hello, Mercato. Edit the paragraph in page.tsx and save to see your change in the browser.
Resume work the next day
The next day, open a terminal in mercato-demo and run:
docker compose start
yarn devWhen you finish, stop the server with Ctrl+C and stop the services with the command below. Your data stays on disk. You can resume work without running yarn setup again.
docker compose stopIf something goes wrong
Corepack is missing or Yarn reports version 1.x
If Corepack is missing, install it with the command below. Then enable Yarn and check its version inside the application directory.
npm install --global corepack
corepack enable
yarn --versionIf installation reports a conflict with an existing Yarn command, remove that older global installation, for example with npm uninstall --global yarn, then install Corepack again.
The database is unreachable or port 5432 is in use
Check docker compose ps and docker compose logs postgres first. If the port is occupied, change both settings below in .env, run docker compose up -d, then retry yarn setup.
POSTGRES_PORT=5433
DATABASE_URL=postgres://postgres:postgres@localhost:5433/open-mercatoYour page returns 404
Check the folder name src/modules/hello, the hello entry in enabledModules, and the default function export in backend/page.tsx. Stop the server, run yarn generate, then yarn dev. The page URL is /backend/hello.