Publish your first free course locally
This walkthrough uses the example course in a freshly generated StratoLMS site. It starts as a draft so a new site does not publish unfinished content. You will edit a lesson, validate the site, deliberately publish the course as free, and open its first lesson on the local development server. No payment provider or email delivery is needed.
If you have not created a project yet, follow the getting-started guide. From the project directory, install dependencies and start with the content check:
pnpm installpnpm stratolms checkStart the development server and leave it running. Use another terminal in the same project for the edit and validation commands below:
pnpm devThe sample course is at
src/content/courses/example-course/_course.mdx. Its first lesson is at
src/content/courses/example-course/01-getting-started/01-edit-this-lesson.mdx.
Change the sentence in that lesson body, below the --- frontmatter block, to
something like:
I can now describe the first step in publishing a course.The dev server reloads when you save. Run the content check again so schema, curriculum, links, media, publication state, and commerce configuration are validated before you view the change:
pnpm stratolms checkNow open _course.mdx. Keep access: free, change status: draft to
status: published, and add a real publication date in YYYY-MM-DD form. For
example:
status: publishedpublishedAt: 2026-10-04access: freeUse the date you are publishing the course; the date above is only an example.
Save the file and run pnpm stratolms check again. A draft is available while
developing but omitted from production catalogues and public discovery output.
Publishing is an explicit content decision; editing a lesson alone does not
publish the course.
Open http://localhost:4321/courses/ and select Your first course. Open its
first preview lesson. Its route follows the numbered course tree:
/learn/example-course/01-getting-started/01-edit-this-lesson/In development, draft courses are shown so you can preview work. To verify the
published behavior, keep status: published, run pnpm stratolms check, then
run pnpm build and pnpm preview. The published free course should appear in
the course catalogue and its free preview lesson should load. This walkthrough
does not test a live deployment, payment, or email provider.
If something blocks the walkthrough
Section titled “If something blocks the walkthrough”- Check the installed Node.js and pnpm versions against the setup guide.
- If the content checker reports a finding, follow its file and rule details; see troubleshooting for common setup and content errors.
- If the published course is absent from a production build, confirm the exact
status: publishedfield and a validpublishedAtdate, then rebuild. - If canonical URLs point to localhost after deployment, set the public site URL as described in the relevant deployment guide.
- If the scaffold command cannot find its package in the registry, use the source checkout workflow for project development. Registry availability is an external service condition.
When you are ready to add payment, use the separate payments guide and qualify the provider flow before accepting real purchases.