Installing and Configuring ExpressionEngine CMS in the ServBay Local Environment
Overview
ExpressionEngine is a powerful and flexible content management system (CMS) widely used for building a variety of complex websites and web applications. It offers a rich set of core features and a highly modular architecture, allowing developers and designers to freely create and customize websites.
ServBay is a one-stop local web development environment designed specifically for macOS. It integrates multiple popular web servers (such as Nginx, Caddy, Apache), programming language runtimes (PHP, Node.js, Python, Go, Java, Ruby, Rust, .NET), databases (MySQL, PostgreSQL, MongoDB, Redis), and developer tools (Composer, npm/yarn, phpMyAdmin/Adminer). With ServBay, developers can easily set up and manage a local development environment.
This article provides a step-by-step guide on installing and configuring ExpressionEngine within ServBay, helping you quickly launch an ExpressionEngine project.
Why Install ExpressionEngine with ServBay?
Installing ExpressionEngine locally using ServBay has the following advantages:
- Integrated Environment: ServBay comes with the required PHP runtime, MySQL database, and web server for ExpressionEngine, eliminating manual setup and configuration.
- Multi-version Support: Easily switch or select different PHP versions in ServBay to meet ExpressionEngine's version requirements.
- Convenient Database Management: ServBay includes phpMyAdmin or Adminer, making it easy to create and manage the database needed for ExpressionEngine.
- Simple Site Configuration: Use ServBay’s graphical interface to quickly create and configure a local site pointing to your ExpressionEngine project directory.
- Isolation and Management: ServBay lets you set up separate website configurations for each project, preventing environment conflicts between projects.
Prerequisites
Before you begin, make sure you meet the following requirements:
- ServBay is installed and running on your macOS system. If you haven't installed ServBay yet, visit the ServBay official website for installation instructions.
- You are familiar with basic terminal command-line operations.
- You have a basic understanding of database concepts (such as databases and users).
- The default website root directory for ServBay
/Applications/ServBay/www
has write permissions.
Installation Steps
We'll go through the following steps to install and configure ExpressionEngine in your ServBay environment.
Step 1: Prepare the Project Directory and Download ExpressionEngine
First, open your Terminal application. Navigate to ServBay’s default web root directory /Applications/ServBay/www
and create a new project directory (for example, servbay-ee-app
), then enter that directory.
cd /Applications/ServBay/www
mkdir servbay-ee-app
cd servbay-ee-app
2
3
Next, use the curl
command to download the latest version of ExpressionEngine into the current directory. The -L
option follows redirects, and -o
specifies the output filename.
curl -L https://expressionengine.com/latest -o expressionengine.zip
Step 2: Unzip ExpressionEngine Files
After the download is complete, use the unzip
command to extract the expressionengine.zip
file into your servbay-ee-app
directory. Once extraction is finished, you can delete the zip package.
unzip expressionengine.zip
rm expressionengine.zip
2
After extracting, the ExpressionEngine file structure will appear inside the servbay-ee-app
directory.
Step 3: Create the ExpressionEngine Database and User
ExpressionEngine requires a database to store its content and configuration. ServBay comes with MySQL and phpMyAdmin for easy database management.
Access ServBay’s Built-in Database Management Tool phpMyAdmin
Open your web browser and visit ServBay’s local tools page:
https://servbay.host/
. Locate and click the "phpMyAdmin" link on the page, which will take you to the phpMyAdmin login page. Use ServBay’s default database username and password (usually found in ServBay’s database settings; by default, you may not need a password to accesslocalhost
).Create a Database User and Database
After logging in to phpMyAdmin, we'll create a dedicated database user and a same-named database for ExpressionEngine.
- Go to the User Accounts Page: On the phpMyAdmin main page, click "User Accounts" in the top navigation.
- Add New User: Click "Add User Account."
- Fill Out User and Database Information:
- Username: Enter a username for ExpressionEngine’s database connection, such as
ee_user
. - Hostname: Select
localhost
. This restricts the user to connecting from the local machine, improving security. - Password: Enter a secure password to be used by ExpressionEngine for the database connection. Remember this password. For demo, you might use
password123
, but always use a strong password in production. - Re-type: Re-enter the password for confirmation.
- Create Database for User: Tick "Create database with same name and grant all privileges." This will automatically create a database called
ee_user
and grant all privileges to the newee_user
user.
- Username: Enter a username for ExpressionEngine’s database connection, such as
- Check Privileges: Ensure there are no unnecessary privileges selected under "Global Privileges" (since we’ve already granted all needed privileges at the database level).
- Go: Click the "Go" button at the bottom of the page to finalize user and database creation.
You now have a database called
ee_user
and a corresponding useree_user
with full permissions for that database.
Step 4: Configure the Website in ServBay
Next, we need to tell ServBay how to handle requests for a specific domain (such as servbay-ee.local
) and map them to your ExpressionEngine project directory.
Open ServBay and Add a New Site
Open the ServBay GUI. In the left navigation bar, click "Sites." Then click the "+" or "Add" button at the top to add a new site configuration.
- Name: Give your site an easy-to-recognize name, such as
My ExpressionEngine Site
. - Domain: Enter the local domain you want to use for your ExpressionEngine site, e.g.,
servbay-ee.local
. ServBay will automatically add this domain to your hosts file, mapping it to 127.0.0.1. - Type: Choose
PHP
since ExpressionEngine is PHP-based. - PHP Version: Select a PHP version compatible with your ExpressionEngine version. ServBay supports multiple PHP versions—pick as needed.
- Document Root: Click the browse button and select your ExpressionEngine project directory created in Step 1, i.e.,
/Applications/ServBay/www/servbay-ee-app
. - Web Server: You can choose any web server supported by ServBay, such as Nginx, Caddy, or Apache. ServBay will generate the appropriate configuration files for you. The default option is suitable for most local development.
- Name: Give your site an easy-to-recognize name, such as
Save and Apply Configuration
Once all information is complete, click "Save" or "Apply." ServBay may need to restart its web server to apply the new configuration. Follow the prompts and wait for ServBay to finish restarting.
Now, when you visit
https://servbay-ee.local/
in your browser, ServBay will route the request to your ExpressionEngine project directory.
Step 5: Run the ExpressionEngine Web Installer
ExpressionEngine provides a web-based installer to guide you through the final configuration.
Access the Installation Page
Open your browser and visit the domain you set up in ServBay, appending the ExpressionEngine installer entry file
admin.php
(by default, the installer is at/admin.php
).Visit:
https://servbay-ee.local/admin.php
You should see the ExpressionEngine welcome or install wizard page.
Follow the Install Wizard
The ExpressionEngine install wizard will ask you for these key details:
- Database Connection Information:
- Database Host:
localhost
- Database Name:
ee_user
(same as the database created in Step 3) - Database Username:
ee_user
(same as the database user created in Step 3) - Database Password: enter the password you set for
ee_user
in Step 3.
- Database Host:
- Administrator Account: Set up the ExpressionEngine super admin account, including username, password, and email. Be sure to use a strong password.
- Site Configuration: Specify site name, URL, and other basic information.
- Database Connection Information:
Complete the Installation
Double-check your input, then click "Install" or the appropriate finish button in the wizard. ExpressionEngine will create the required database tables and perform initial setup.
When installation is complete, you’ll usually be redirected to the login page or admin dashboard.
Step 6: Perform Basic Post-Installation Setup
Once the ExpressionEngine core installation is complete, you can install plugins, templates, or perform other initial configurations as needed.
Log in to the ExpressionEngine Admin
Log in with the admin account you created during setup at
https://servbay-ee.local/admin.php
with your username and password.Install Add-Ons
In the ExpressionEngine admin, go to "Developer" -> "Add-Ons" -> "Plugins". You can browse available plugins and install them as needed for your project.
Install and Configure Templates
Navigate to "Design" -> "Templates". Here, you can create template groups and templates, and write HTML/CSS/EE code for rendering your site content.
Building Your Site with ExpressionEngine
Now that you’ve successfully installed and configured ExpressionEngine in your ServBay environment, you can begin building and managing your website content. Here are some common starting points:
Creating Channels and Entries
The core of ExpressionEngine is "channels" and "entries". Channels define the type and structure of content, while entries are the actual pieces of content.
- Create a Channel: In the ExpressionEngine admin, go to "Content Structure" -> "Channels". Click "Create New Channel", fill in the channel name, field group, and other settings, then click "Save Channel".
- Create an Entry: Navigate to "Content" -> "Publish". Select the channel you just created, fill in the entry title, content (based on the channel’s fields), and other information, then click "Save".
Setting Up the Navigation Menu
Navigation menus are commonly implemented using templates.
- Create or Edit a Template: In "Design" -> "Templates", find or create a template for your site navigation (for example, a
nav
template inside asite
template group). - Write Navigation Code: Use ExpressionEngine template tags in your template to query channel entries or pages and generate the HTML structure for navigation.
- Include Navigation in Layout: In your main page layout template, use
{% include 'site:nav' %}
(if using Blade templating) or the appropriate tag to include the navigation template.
Customizing Widgets/Sidebars
Like navigation, sidebars or other "widget" areas are typically handled by creating specific templates.
- Create a Widget Template: In "Design" -> "Templates", create a template for your widget content (e.g.,
site:sidebar
). - Write Widget Code: Add code in the template to display latest entries, categories, ads, etc.
- Include the Widget in Layout: Add the widget template to your page layout wherever you need it displayed.
Frequently Asked Questions (FAQ)
- Q: What should I do if I get a permission error accessing
https://servbay-ee.local/
?- A: Check that your ExpressionEngine project directory (
/Applications/ServBay/www/servbay-ee-app
) and its subdirectories and files have the correct permissions. Ensure the user running ServBay (usually your current user) has read and write permissions for these files. You might need to adjust permissions usingchmod
orchown
, e.g.,sudo chown -R yourusername:yourgroup /Applications/ServBay/www/servbay-ee-app
.
- A: Check that your ExpressionEngine project directory (
- Q: The ExpressionEngine install wizard says it can’t connect to the database—what now?
- A: Double-check the database connection info you entered in the installer (database host
localhost
, database name, username, password), ensuring it matches exactly the details you created in phpMyAdmin. Also, make sure the MySQL/MariaDB service is running in ServBay.
- A: Double-check the database connection info you entered in the installer (database host
- Q: Can I use other databases in ServBay (like PostgreSQL) with ExpressionEngine?
- A: ExpressionEngine mainly supports MySQL/MariaDB. If the ExpressionEngine official documentation supports PostgreSQL and you have the required drivers/configuration, in theory you can use ServBay’s PostgreSQL service. However, this depends on ExpressionEngine’s compatibility. Refer to the official ExpressionEngine documentation for supported database types.
Summary
By following the steps in this guide, you should now have successfully installed and configured ExpressionEngine CMS in your ServBay local development environment. ServBay provides a convenient and efficient environment for local ExpressionEngine development with all necessary components integrated. You’re ready to start building your site or web application using the full power of ExpressionEngine. Happy coding!