Installing Brightspot locally
You can run a bare-bones instance of Brightspot on your own computer for development and evaluation. The Brightspot Quick Start project on GitHub is a template that contains everything needed to build Brightspot and run it in Docker containers.
The Quick Start project and the Brightspot Docker images are for local development only. They are not intended for production use.
Prerequisites
Install the following software before you begin.
| Software | Version | Notes |
|---|---|---|
| Java Development Kit (JDK) | 11 | The Quick Start project compiles against Java 11. |
| Docker | Docker Desktop, or Docker Engine with the Docker Compose plugin | Docker runs the database, search, application, and web servers. |
| Git | Any current version | Required to clone the Quick Start project. |
You do not need to install Gradle. The project includes the Gradle wrapper (gradlew and gradlew.bat), which downloads the correct version of Gradle the first time you run it.
Make sure the following ports are not in use by other applications on your computer.
| Port | Used by |
|---|---|
| 80 | Apache web server (HTTP) |
| 443 | Apache web server (HTTPS) |
| 5005 | Java remote debugger for Tomcat |
| 8081 | Solr |
If the CMS is slow to start or the Tomcat container stops unexpectedly, increase the memory available to Docker to at least 4 GB in Docker Desktop's resource settings.
How the local environment works
The Quick Start project builds Brightspot into a .war file with Gradle. Docker Compose then starts four containers that run the application.
| Container | Image | Purpose |
|---|---|---|
mysql | brightspot/mysql | Stores content and configuration. |
solr | brightspot/solr | Provides search indexing. |
tomcat | brightspot/tomcat | Runs Brightspot from the .war file in web/build/libs/. |
apache | brightspot/apache | Serves requests on http://localhost and forwards them to Tomcat. |
The containers store their data in named Docker volumes, so your content persists when you stop and restart the containers.
The Brightspot version is set in the project's settings.gradle file, in the brightspot-bom and brightspot-dependencies library entries.
Installing and starting Brightspot
To install and start Brightspot:
-
Make sure Docker is running.
-
Make sure the
JAVA_HOMEenvironment variable points to your JDK 11 installation. -
Clone the Quick Start project, and change to its directory.
1git clone https://github.com/brightspot/quick-start.git2cd quick-start -
Build the project.
macOS and Linux
1./gradlewWindows Command Prompt
1gradlew.batWindows PowerShell
1.\gradlew.batThe first build downloads Gradle and all Brightspot dependencies, so it can take several minutes. Subsequent builds are faster.
-
Start the containers in the background.
1docker compose up -dThe first time you run this command, Docker downloads the Brightspot images. Docker Compose may warn that the
versionattribute is obsolete. You can ignore this warning. -
In a browser, open
http://localhost/cms.Brightspot takes a few seconds to start after the containers are running. If the page does not load, wait a moment and refresh until the login page appears.
Logging in for the first time
A new installation has no users. The first time you open the CMS, the login page displays a welcome message stating that you are the first user.
To create the first administrator account:
- Type an email address or username, and a password.
- Click Log In.
Brightspot creates the account with administrator privileges. Use this account to create additional users, configure sites, and create content.
Rebuilding after code changes
The tomcat container runs the .war file that Gradle builds in web/build/libs/. After you change your project's code, rebuild the .war file and restart Tomcat to deploy it.
1./gradlew2docker compose restart tomcat
On Windows, run gradlew.bat (Command Prompt) or .\gradlew.bat (PowerShell) instead of ./gradlew.
Viewing logs
To follow the Tomcat logs, run the following command:
1docker compose logs -f --tail=1000 tomcat
To view the logs for another container, replace tomcat with the container name, such as mysql or solr. Press Ctrl+C to stop following the logs.
Stopping and starting Brightspot
The following table lists common Docker Compose commands for managing the local environment. Run these commands from the project directory.
| Task | Command | Effect on data |
|---|---|---|
| Stop the containers | docker compose stop | Data is kept. |
| Start stopped containers | docker compose start | Data is kept. |
| Remove the containers | docker compose down | Data in named volumes is kept. |
| Remove the containers and all data | docker compose down -v | Deletes the database, search index, and uploaded files. |
Running docker compose down -v permanently deletes all content, users, and uploaded files in your local instance. The next time you start the containers, Brightspot starts with an empty database.
Debugging
The tomcat container exposes a Java remote debugging port on 5005. To debug Brightspot from your IDE, create a remote JVM debug configuration that attaches to localhost:5005.
Troubleshooting
| Problem | Solution |
|---|---|
http://localhost/cms does not load right after starting the containers. | Brightspot is still starting. Wait a few seconds and refresh the page. To check progress, view the Tomcat logs. |
| Docker reports that a port is already allocated. | Another application is using port 80, 443, 5005, or 8081. Stop that application, or change the published port in docker-compose.yml. |
| The Gradle build fails with a Java version error. | Make sure JAVA_HOME points to a JDK 11 installation, and run the build again. |
The Gradle build fails with Downloading from https://services.gradle.org/... failed: timeout (10000ms). | The Gradle wrapper stops a download that receives no data for 10 seconds, which can happen on slow networks. In gradle/wrapper/gradle-wrapper.properties, increase the networkTimeout value (in milliseconds), for example to 120000, and run the build again. |
On Linux or WSL, Docker commands fail with permission denied while trying to connect to the .... | Your account is not in the docker group, or your terminal session started before you were added to it. Run sudo usermod -aG docker $USER, and then open a new terminal session. |
In WSL, the docker command is not found. | Docker Desktop adds the docker command to WSL only while it is running. Start Docker Desktop, and make sure your WSL distribution is turned on in Docker Desktop under Settings > Resources > WSL integration. Then open a new terminal session. |
docker compose up -d fails while downloading an image with unexpected EOF. | The download was interrupted. Run docker compose pull to download the images again, and then run docker compose up -d. |
After Docker Desktop restarts, only the tomcat container is running. | The tomcat container restarts automatically, but the other containers do not. Run docker compose up -d to start them. |
After Docker Desktop restarts, the containers are running but http://localhost/cms returns 404 Not Found. | The tomcat container lost access to the project directory, so it cannot find the .war file. Run docker compose up -d --force-recreate tomcat to re-create the container. Your content is kept, because it is stored in named volumes. |
| Changes to your code do not appear in the CMS. | Rebuild the project and restart the tomcat container. See Rebuilding after code changes. |
Next steps
After Brightspot is running, you can start building your project. To model your first content type, see Creating a content type. Some features, such as collections, require a task host. To find the task host for your local tomcat container, see Determining a task host in a local development environment.