### Run Neos Setup Tool via Command Line
Source: https://docs.neos.io/guide/installation-development-setup/running-the-setup-tool
Initiates the Neos setup process through the command line. This command can be executed locally, within a Ddev environment, or a Docker Compose environment. It checks for prerequisites and guides through the setup steps.
```bash
./flow setup
```
```bash
ddev exec ./flow setup
```
```bash
docker compose exec neos /app/flow setup
```
--------------------------------
### Create New Site Package and Instance (Neos)
Source: https://docs.neos.io/guide/installation-development-setup/running-the-setup-tool
Creates a new, empty site package and then registers a new site instance within Neos. This is the starting point for building a custom Neos website. It uses the kickstart and site commands.
```bash
# create site package
./flow kickstart:site Vendor.Site
# create site instance
./flow site:create vendor-site Vendor.Site Vendor.Site:Document.Site
```
--------------------------------
### Setup Local Web Server for Neos Development
Source: https://docs.neos.io/guide/contributing-to-neos/neos-core
This snippet outlines the steps to set up a local web server for Neos development. It involves cloning the Neos development distribution, installing Composer dependencies, and running the Neos development server. Users are instructed to access the setup via a provided URL.
```bash
mkdir -p /your/local/path
cd /your/local/path
git clone https://github.com/neos/neos-development-distribution.git
cd neos-development-distribution
curl -s https://getcomposer.org/installer | php
php composer.phar install
./flow server:run & echo "Open http://localhost:8081/setup and follow the instruction on the screen"
```
--------------------------------
### Clone Project and Install Dependencies
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/devbox
Clones an existing Neos project from a Git repository and installs its dependencies. This is a standard step for starting development on a new or existing project.
```shell
git clone https://YOUR-PROJECT-URL-HERE your-project
cd your-project
```
--------------------------------
### Configure Post-Start Hooks in DDEV
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/all-platforms-using-ddev-and-docker
Sets up commands to be executed automatically after a DDEV environment starts. This is useful for tasks like installing dependencies, rescanning packages, and migrating databases.
```yaml
hooks:
post-start:
- exec: composer install
- exec: ./flow neos.flow:package:rescan
- exec: ./flow database:setcharset
- exec: ./flow doctrine:migrate
```
--------------------------------
### Install Dependencies for Existing Neos Project
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mac-os-linux-using-the-embedded-web-server
This section explains how to set up an existing Neos project. It involves cloning the project repository and then running 'composer install' to fetch all necessary dependencies. Both native Composer and Docker-based Composer methods are provided.
```bash
git clone http://YOUR-PROJECT-URL-HERE your-project
cd your-project
composer install
```
```bash
git clone http://YOUR-PROJECT-URL-HERE your-project
cd your-project
docker run -v .:/app -it --rm composer install
```
--------------------------------
### Start Neos Embedded Development Server
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mac-os-linux-using-the-embedded-web-server
This command starts the embedded development web server for a Neos project. The server runs on http://127.0.0.1:8081. Initial startup may take longer due to class analysis and precompilation.
```bash
./flow server:run
```
--------------------------------
### Basic Fusion Root Path Example
Source: https://docs.neos.io/guide/rendering/rendering-a-page
A simple example demonstrating how setting the 'root' path in Fusion to a string will render that string directly. This illustrates the starting point of the Fusion rendering process.
```fusion
root = "Hello World!"
```
--------------------------------
### Install Composer using curl
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/manual-installation-with-a-web-server
Installs Composer, the PHP dependency manager, by downloading and executing the installer script. This is a prerequisite for installing Neos.
```bash
curl -sS https://getcomposer.org/installer | php
```
--------------------------------
### Install MariaDB Server on Debian
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mac-os-linux-using-the-embedded-web-server
Installs the MariaDB server on Debian systems, which replaces MySQL in the Debian repository. It also includes commands to start the service and secure the installation.
```bash
sudo apt install mariadb-server
sudo service mysql start
# Answer all with (Y)es
sudo mysql_secure_installation
# Enter the MySQL Shell (ctrl+c to exit)
sudo mysql
```
--------------------------------
### Import Demo Site Content (Neos)
Source: https://docs.neos.io/guide/installation-development-setup/running-the-setup-tool
Imports all demo content from the specified Neos package. This is useful for quickly testing Neos functionality. It requires the Neos.Demo package to be installed.
```bash
./flow site:importall --package-key Neos.Demo
```
--------------------------------
### Start Local Beach Development Server
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/all-platforms-using-localbeach-and-docker
Starts the Local Beach development environment. This command initiates the Docker containers and makes the Neos instance accessible via a local URL, typically displayed on the command line after successful startup.
```bash
beach start
```
--------------------------------
### Set up Neos Content Repository
Source: https://docs.neos.io/guide/installation-development-setup/running-the-setup-tool
Initializes the Content Repository for Neos, creating necessary database tables and an empty Event Store. This step is required before setting up the first Neos site.
```none
./flow cr:setup --content-repository default
```
--------------------------------
### Install Composer (Bash)
Source: https://docs.neos.io/cms/installation-development-setup/docker-and-docker-compose-setup
Installs Composer, the PHP dependency manager, by downloading the installer script and then moving the executable to a global path. This allows for easy access to Composer commands from any directory.
```bash
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
```
--------------------------------
### Clone and Install Dependencies for Existing Neos Project
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/all-platforms-using-localbeach-and-docker
Clones an existing Neos project from a Git repository and installs its dependencies using Composer. This is for developers working on pre-existing Neos projects.
```bash
git clone http://YOUR-PROJECT-URL-HERE your-project
cd your-project
composer install
```
--------------------------------
### Clone Neos Dev Distribution and Start with Docker
Source: https://docs.neos.io/guide/contributing-to-neos/neos-core
This snippet clones the Neos development distribution repository and starts the Neos instance using Docker Compose. It initializes the database, creates a Neos instance with demo content, sets up an admin user, and starts the Neos instance on localhost:8081.
```bash
git clone git@github.com:neos/neos-development-distribution.git
cd neos-development-distribution
docker compose up
```
--------------------------------
### Navigate to web server directory
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/manual-installation-with-a-web-server
Changes the current directory to the web server's document root, where the Neos project will be placed.
```bash
cd /your/htdocs/
```
--------------------------------
### Start Devbox Services
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/devbox
Starts the development services configured in Devbox. This command brings up all the services defined in the Process Compose file, making the Neos application accessible for local development.
```shell
devbox services up
```
--------------------------------
### Install Local Beach CLI using Homebrew
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/all-platforms-using-localbeach-and-docker
Installs the Local Beach command-line interface using Homebrew. This involves tapping a repository and then installing the package. The `beach version` command verifies the installation.
```bash
brew tap flownative/flownative
brew install localbeach
beach version
```
--------------------------------
### Create Neos Project with Composer
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mamp
Creates a new Neos project named 'neos-example' in the current directory using the Neos base distribution. This command requires Composer to be installed and is typically run within the MAMP htdocs folder.
```bash
composer create-project neos/neos-base-distribution neos-example
```
--------------------------------
### Install Neos via Composer
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/xampp-setup-windows
This command uses Composer to create a new Neos project. It downloads the base distribution and sets up the project in the specified directory. Ensure you have Composer installed and are in the correct directory (e.g., htdocs) before running this command.
```bash
composer create-project neos/neos-base-distribution mySite
```
--------------------------------
### Create new Neos project with Composer
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/manual-installation-with-a-web-server
Creates a new Neos project from the base distribution using Composer. This command sets up the initial project structure and downloads dependencies.
```bash
# with native Composer:
composer create-project neos/neos-base-distribution neos-example
# ALTERNATIVE, with Composer through Docker:
docker run -v .:/app -it --rm composer create-project neos/neos-base-distribution neos-example
```
--------------------------------
### Create Neos Project with Composer
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mac-os-linux-using-the-embedded-web-server
This snippet demonstrates how to create a new Neos project using Composer. It provides two methods: using native Composer installation and using Composer through Docker. The output is a new Neos project directory named 'neos-example'.
```bash
composer create-project neos/neos-base-distribution neos-example
```
```bash
docker run -v .:/app -it --rm composer create-project neos/neos-base-distribution neos-example
```
--------------------------------
### Initialize Git repository for Neos project
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/manual-installation-with-a-web-server
Initializes a new Git repository for the Neos project, stages all files, and creates an initial commit. This helps in tracking changes and reproducibility.
```bash
cd neos-example
git init
git add .
git commit -m "TASK: Initial Commit"
# optionally, also run "git remote add ..." and "git push"
```
--------------------------------
### Install PHP and MariaDB on Mac OS
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mac-os-linux-using-the-embedded-web-server
Installs PHP and MariaDB version 10.6 on Mac OS using Homebrew. It's recommended to also install Sequel Ace for database management.
```bash
brew install php mariadb@10.6
```
--------------------------------
### Clone Existing Neos Project with DDEV
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/all-platforms-using-ddev-and-docker
Steps to set up an existing Neos project with DDEV. This involves cloning the project repository, configuring DDEV for the project's document root, and installing project dependencies using Composer.
```bash
git clone http://YOUR-PROJECT-URL-HERE your-project
cd your-project
ddev config --docroot=Web --create-docroot --project-type=php
ddev composer install
```
--------------------------------
### Create New Neos Project with DDEV
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/all-platforms-using-ddev-and-docker
Commands to initialize a new Neos project using DDEV. This includes creating a project directory, configuring DDEV for PHP, creating the project structure with Composer (disabling scripts initially), and installing dependencies. It also covers initializing a Git repository.
```bash
mkdir neos-example
cd neos-example
ddev config --docroot=Web --project-type=php
ddev composer create --no-scripts neos/neos-base-distribution
ddev composer install
git init
git add .
git commit -m "TASK: Initial Commit"
```
--------------------------------
### Install Dependencies for Existing Project (Bash)
Source: https://docs.neos.io/cms/installation-development-setup/docker-and-docker-compose-setup
Clones an existing Neos project and installs its dependencies using Composer. Supports both native Composer execution and running Composer commands via Docker.
```bash
git clone http://YOUR-PROJECT-URL-HERE your-project
cd your-project
# with native Composer:
composer install
# ALTERNATIVE, with Composer through Docker:
docker run -v .:/app -it --rm composer install
```
--------------------------------
### Install PHP 8.2 and Extensions on Debian
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mac-os-linux-using-the-embedded-web-server
Installs PHP 8.2 and common/required extensions for Neos on Debian systems. This includes extensions for common functionalities like mbstring, mysql, xml, imagick, curl, intl, and igbinary.
```bash
sudo apt install php8.2 php8.2-{common,mbstring,mysql,xml,imagick,curl,intl,igbinary}
```
--------------------------------
### Move Composer executable
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/manual-installation-with-a-web-server
Moves the downloaded composer.phar file to a global bin directory, making the 'composer' command accessible system-wide.
```bash
mv composer.phar /usr/local/bin/composer
```
--------------------------------
### Install Neos Kickstarter
Source: https://docs.neos.io/cms/manual/using-neos-with-php-flow/creating-a-plugin
Installs the Neos Kickstarter package, a prerequisite for generating Flow packages and models.
```bash
composer require neos/kickstarter *
```
--------------------------------
### Run Doctrine Migrations for Neos
Source: https://docs.neos.io/guide/installation-development-setup/running-the-setup-tool
Applies database migrations to set up the necessary table structure for Neos. This command should be run after the database connection has been successfully configured.
```none
./flow doctrine:migrate
```
--------------------------------
### Configure Apache Virtual Host for Neos
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/manual-installation-with-a-web-server
Sets up a virtual host in Apache to serve a Neos project. It specifies the DocumentRoot and enables .htaccess overrides. Ensure mod_rewrite is loaded and Apache is restarted.
```apache
NameVirtualHost *:80 # if needed
DocumentRoot "/your/htdocs/Neos/Web/"
# enable the following line for production context
#SetEnv FLOW_CONTEXT Production
ServerName neos.demo
AllowOverride All
```
--------------------------------
### Build and Run Neos Docker Containers
Source: https://docs.neos.io/cms/installation-development-setup/docker-and-docker-compose-setup
Commands to build the Docker images and start the Neos CMS and database services in detached mode. This process creates the containers and sets up the necessary volume mounts.
```bash
docker compose build
docker compose up -d
```
--------------------------------
### Configure Neos Image Handler
Source: https://docs.neos.io/guide/installation-development-setup/running-the-setup-tool
Sets up the image handler for Neos, which is responsible for creating thumbnails for uploaded assets. It evaluates available image handlers based on server software and allows the user to select a preferred handler, updating the configuration accordingly.
```bash
./flow setup:imagehandler
Select Image Handler (Gmagick):
[Gmagick] Gmagick php module
>
# [press ENTER to use the proposed image handler]
# output:
Neos:
Imagine:
driver: Gmagick
The new image handler setting were written to Configuration/Settings.Imagehandling.yaml
```
--------------------------------
### Add DEB.SURY.ORG Repository for Latest PHP on Debian
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mac-os-linux-using-the-embedded-web-server
Adds the DEB.SURY.ORG third-party repository to access more recent PHP versions on Debian systems. It includes updating the system, installing necessary packages for secure data transfer, adding the GPG key, and adding the repository source.
```bash
# (Update your system)
sudo apt update && sudo apt upgrade
# Transfer data safely (SSL) and more
sudo apt -y install apt-transport-https lsb-release ca-certificates wget
# Add GPG key
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
# Add the DEB.SURY.ORG repository
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update
```
--------------------------------
### Determine Active Context and Neos Version
Source: https://docs.neos.io/guide/installation-development-setup/running-the-setup-tool
Displays the active application context and Neos version. This information is crucial for debugging installation and setup issues. Run this command from the root of your Neos installation.
```bash
./flow
```
--------------------------------
### Create a New Neos Project from Scratch
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/all-platforms-using-localbeach-and-docker
Creates a new Neos project using Composer's `create-project` command with the `neos/neos-base-distribution`. It then initializes a Git repository and makes an initial commit.
```bash
composer create neos/neos-base-distribution neos-example
cd neos-example
git init
git commit --allow-empty -m "TASK: Initialize empty repository"
git add .
git commit -m "TASK: Initial commit"
```
--------------------------------
### Initialize Git Repository for Neos Project
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mac-os-linux-using-the-embedded-web-server
After creating a Neos project, it's recommended to initialize a Git repository for version control. This involves navigating into the project directory, initializing Git, adding all files, and making an initial commit.
```bash
cd neos-example
git init
git add .
git commit -m "TASK: Initial Commit"
```
--------------------------------
### Process Compose Configuration for Neos Services
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/devbox
Defines services for a Neos project using Process Compose, similar to Docker Compose. It includes a 'server' process that runs the Neos flow server and a 'composer install' process that must complete successfully before the server starts.
```yaml
version: "0.5"
processes:
app:server:
command: ./flow server:run
depends_on:
composer:install:
condition: process_completed_successfully
composer:install:
command: composer install
```
--------------------------------
### Create New Neos Project
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mac-os-linux-using-the-embedded-web-server
Commands to create a new Neos project from scratch. This involves setting up the base directory structure and downloading all necessary dependencies using Composer.
```bash
# Commands to create a new Neos project from scratch
# (Specific commands for project creation are missing in the provided text, but this is the placeholder for them)
```
--------------------------------
### Install Composer (macOS/Linux)
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/mamp
Installs Composer, the PHP dependency manager, on macOS and Linux systems using a curl command to download the installer and then executing it with PHP. This is a prerequisite for installing Neos.
```bash
curl -sS https://getcomposer.org/installer | php
```
```bash
mv composer.phar /usr/local/bin/composer
```
--------------------------------
### Set Neos File Permissions (Unix/Mac)
Source: https://docs.neos.io/guide/installation-development-setup/manual-setup/manual-installation-with-a-web-server
Sets file permissions for a Neos installation on Unix-like systems. It uses the `flow core:setfilepermissions` command to grant read and write access to the web server's user and group. Replace placeholders with actual usernames and group names.
```bash
sudo ./flow core:setfilepermissions john www-data www-data
```
--------------------------------
### Dockerfile for Neos Development
Source: https://docs.neos.io/cms/installation-development-setup/docker-and-docker-compose-setup
A Dockerfile for a Neos development environment. It installs necessary PHP extensions (gmagick, pdo_mysql, redis, intl), sets the working directory, exposes port 8081, copies project files into the container, and starts the Neos Flow development server.
```dockerfile
FROM php:8.2-cli
RUN apt-get update \
# install GraphicsMagick
&& apt-get install -y \
libgraphicsmagick1-dev graphicsmagick zlib1g-dev libicu-dev gcc g++ --no-install-recommends \
&& pecl -vvv install gmagick-beta && docker-php-ext-enable gmagick \
# pdo_mysql
&& docker-php-ext-install pdo_mysql \
# redis
&& pecl install redis && docker-php-ext-enable redis \
# intl
&& docker-php-ext-configure intl && docker-php-ext-install intl \
# cleanup
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
EXPOSE 8081
# copy everything in the project into the container. This is what
# makes this image so fast!
COPY . /app
# start the dev server
CMD [ "./flow", "server:run", "--host", "0.0.0.0" ]
```
--------------------------------
### Setup Content Repository Tables
Source: https://docs.neos.io/api/upgrade-instructions/version-9-x/upgrade-instructions-8-3-9-0/database-migration
Runs commands to set up new tables in the database for the content repository. This is a prerequisite for content migration.
```bash
./flow doctrine:migrate
./flow cr:setup
```
--------------------------------
### Controller Action Fusion File Example
Source: https://docs.neos.io/guide/advanced/extending-neos-with-php-flow/creating-afx-based-applications-backend-modules
This Fusion file maps a specific controller action (e.g., BlogPostController's index action) to a Fusion page template (e.g., Your.Package:Page.DefaultPage). It demonstrates how to use the afx syntax for embedding content.
```fusion
Your.Package.BlogPostController.index = Your.Package:Page.DefaultPage {
body.content = afx`
this should be the main body content.
`
}
```
--------------------------------
### Install New Package via Composer in Neos
Source: https://docs.neos.io/cms/installation-development-setup/docker-and-docker-compose-setup
Instructions for installing a new package using Composer within the Neos Docker environment. After running the composer command, it's necessary to adjust `docker-compose.yml` for volume mappings, rebuild the container, and restart it.
```bash
# Run your composer command as usual
# adjust docker-compose.yml as explained in Step 6 above
# then stop the container, build it and start it again again (as explained above).
```
--------------------------------
### Describe DDEV Project Environment
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/all-platforms-using-ddev-and-docker
Provides information about accessing the Neos project, PHPMyAdmin, MailHog, and database connection details within the DDEV environment.
```bash
ddev describe
```
--------------------------------
### Setup Content Repository and Replay Trash Bin Projection (Flow)
Source: https://docs.neos.io/api/upgrade-instructions/version-9-x/upgrade-instructions-9-0-9-1
Initializes the content repository for the new Content recovery functionality and replays the TrashBinProjection. These commands are necessary to enable the content recovery button in the Neos UI.
```bash
./flow cr:setup
./flow subscription:replay Neos.Workspace.Ui:TrashBinProjection
```
--------------------------------
### Example Neos Content Repository Performance Profile Output
Source: https://docs.neos.io/guide/content-repository/performance-profiling
This is an example of the output generated by the Neos Content Repository performance profiler. It shows a trace of operations, including the start and end times, the function or command being executed, and the duration of each step. This format helps in identifying performance bottlenecks.
```text
=== Trace started at 2025-10-23 15:31:54 ===
[1761233514.999921] > ContentRepository::handle {"c":"Neos\\ContentRepository\\Core\\Feature\\NodeMove\\Command\\MoveNodeAggregate"}
[1761233515.001142] • AuthProvider::canExecuteCommand (+1.2 ms)
[1761233515.014465] • CommandBus::handle (+13.3 ms)
[1761233515.024987] • EventStore::commit (+10.5 ms)
[1761233515.025036] > SubscriptionEngine::catchUpSubscriptions
[1761233515.033295] • Projection::apply (+7.6 ms) {"subscription":"contentGraph","event":"NodeAggregateWasMoved"}
[1761233515.035002] • Projection::apply (+1.7 ms) {"subscription":"Neos.Neos:DocumentUriPathProjection","event":"NodeAggregateWasMoved"}
[1761233515.036070] • Projection::apply (+1.1 ms) {"subscription":"Neos.Neos:PendingChangesProjection","event":"NodeAggregateWasMoved"}
[1761233515.045640] < SubscriptionEngine::catchUpSubscriptions (20.604 ms)
[1761233515.045649] • SubscriptionEngine::catchUpActive (+9.6 ms)
[1761233515.045677] < ContentRepository::handle (45.756 ms)
```
--------------------------------
### Initialize New Content Repository Database Tables (Neos CLI)
Source: https://docs.neos.io/guide/content-repository/multiple-content-repositories-v9
This command-line instruction is used to set up the necessary database tables for a newly registered content repository. Replace '' with the actual name of the content repository defined in Settings.yaml.
```bash
./flow cr:setup --content-repository
```
--------------------------------
### Initialize Devbox and Add Packages
Source: https://docs.neos.io/guide/installation-development-setup/ddev-local-beach/devbox
Initializes Devbox for a project, generates direnv configuration, and adds specific package versions (PHP 8.3 and MySQL 8.0) to the development environment. This configuration should be added to version control.
```shell
devbox init
devbox generate direnv
devbox add php@8.3 mysql80
```
--------------------------------
### YAML Configuration Example
Source: https://docs.neos.io/guide/essentials/configuration-editor
Demonstrates the basic syntax and structure of YAML files used for Neos and Flow configuration. It shows how to define strings, numbers, booleans, and arrays, including a practical example of disabling session timeouts.
```yaml
# This is an example for a YAML file.
# Those files end with .yml or .yaml
string1: Hello
string2: "Hello"
number: 1233
bool: true
# Both array definitions are equal.
Array:
- First
- Second
- Third
Array: ["First", "Second", "Third"]
# This is a real example. It disabled the automatic
# logout after 60min of inactivity.
Neos:
Flow:
session:
inactivityTimeout: 0
```