Installing SilverStripe on localhost
Setting up a local development environment for SilverStripe CMS, running the PHP site and backend at http://localhost/silverstripe.
SilverStripe is a PHP CMS framework developed in New Zealand, balancing content management with a developer API, suitable for custom enterprise sites. Local installation allows for theme and DataObject model development.
Prerequisites
- PHP 8.1+ (refer to SilverStripe documentation)
- Composer 2
- MySQL/MariaDB or PostgreSQL
- Apache/Nginx + URL rewriting
Installation Steps
composer create-project silverstripe/installer silverstripePlace the project in a web-accessible directory or configure the virtual host DocumentRoot to point to public/.
- Create a database
silverstripe_localusing phpMyAdmin. - Copy
.env.exampleto.envand configure the database:
SS_DATABASE_CLASS="MySQLDatabase"
SS_DATABASE_SERVER="localhost"
SS_DATABASE_USERNAME="root"
SS_DATABASE_PASSWORD=""
SS_DATABASE_NAME="silverstripe_local"- Access the site in your browser at http://localhost/silverstripe (or your
public/URL). - Run
/dev/build?flush=1to initialize the database (development environment). - The default admin can be set during the installation process or in the
.envfile.
Common Paths
| Path | Description |
|---|---|
/ | Frontend |
/admin | CMS Backend |
/dev/build | Build database schema (development) |
Development Tips
- Themes are located in
themes/orapp/src/(depending on project structure). - After modifying models, visit
dev/build. - Ensure to disable
dev/routes in production.
Frequently Asked Questions
500 Error or Permissionsassets/ and silverstripe-cache/ must be writable by the web server.
Slow Composer Installation
Use a domestic mirror or pre-download dependencies.
URL Rewriting
Apache uses public/.htaccess; Nginx requires configuration of try_files.
Summary
SilverStripe is installed via Composer, accessible locally at http://localhost/silverstripe, with the backend at /admin, making it suitable for PHP developers to customize the CMS.