Andres Developer Hero Image

Create a Website From Scratch

Learn the essential steps to build a website from scratch, from the basic structure to the final deployment. Ideal for those who want quick and practical results.

Creating a website with OctoberCMS — Guide with code examples

Here you can see step by step and with code snippets how to build a website using OctoberCMS.

1. Preparation
# Minimum requirements (concept)
- PHP 7.4+
- Composer
- Web server (Apache / Nginx)
- Database MySQL / MariaDB


# Create the project (generic example)
composer create-project october/october 
2. Configure the database
# File .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=october_db
DB_USERNAME=user
DB_PASSWORD=password
3. Basic structure of a theme (layout + page)
/* themes/Yourtheme/layouts/default.htm */

{{ this.page.title ?: 'My Site with OctoberCMS' }}
{% styles %}


{% partial 'header' %}


{% page %}


{% partial 'footer' %}
{% scripts %}



/* themes/Yourtheme/pages/home.htm */

title = "Home"
url = "/"
layout = "default"
==