Cortex CMS
Search…
Manual Setup

cortex-starter Preparation

As cortex itself is only a Rails Engine, it needs to be mounted within a parent Rails applicaton. cortex-starter serves as a starting point for new users, with cortex and cortex-plugins-core already mounted and configured with several example ContentTypes/Decorators. Start by cloning the repository:
1
$ git clone [email protected]:cortex-cms/cortex-starter.git && cd cortex-starter
Copied!

Environment

Copy and rename the example .env.example file as .env and modify it to match your environment.
For a rudimentary setup, these variables should be configured:
    Execute $ bin/rails secret twice to generate both an APP_SECRET and DEVISE_SECRET
    If the superuser isn't used for the app databases, the DATABASE_USERNAME and DATABASE_PASSWORD should be set accordingly.

Dependencies

System

macOS

    Install the Xcode Command Line tools:
1
$ xcode-select --install
Copied!
    Install all Cortex system-wide dependencies (and the readline Ruby/byebug build dependency) using Homebrew from the Brewfile via $ brew install $(cat Brewfile|grep -v "#")
    Install Ruby via rbenv or rvm.
    Enable system agents:
1
$ ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
2
$ ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
3
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
Copied!
and start them with brew services:
1
$ brew services start postgresql
2
$ brew services start elasticsearch
3
$ brew services start redis
Copied!
or launchctl:
1
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
3
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Copied!

Linux

    Install all Cortex system-wide dependencies (and the readline Ruby/byebug build dependency) using your distribution's package manager (pacman, apt-get, yum, etc). For example, with Ubuntu's apt-get:
1
$ apt-get install libreadline6-dev postgresql postgresql-contrib redis-server openjdk-8-jre imagemagick jpegoptim ghostscript
Copied!
Ubuntu and Redhat/Fedora do not have an official elasticsearch package - you must use Elasticsearch's repositories for APT or RPM or follow these manual instructions. The same goes for phantomjs. Build from source or use a PPA. Additionally, yarn will need its repository added for these distributions. Follow these instructions. Other Linux distributions likely have these as prebuilt packages in their official or user repositories.
    Install Ruby via rbenv or rvm.
    Enable & start system agents using your distribution's service manager frontend, which is likely systemd's frontend, systemctl:
1
$ systemctl enable --now postgresql elasticsearch redis
Copied!

Application

    Install Bundler and its dependencies:
1
$ gem install bundler && bin/bundle install
Copied!
    Install node dependencies using yarn:
1
$ bin/yarn install
Copied!

Data Provisioning

Quick

cortex-starter ships with an automated setup script. Execute this in lieu of the Manual Setup steps below, if you're comfortable doing so:
1
$ bin/setup
Copied!

Manual

    Create databases:
1
$ bin/rails db:create
Copied!
    Initialize the schema:
1
$ bin/rails db:schema:load
Copied!
    Seed database with a top-level tenant, the superuser and Custom Content data, then rebuild the Elasticsearch index:
1
$ bin/rails db:seed
2
$ bin/rails cortex_starter:content_types:seed
3
$ bin/rails cortex:rebuild_indexes
Copied!

Server

Start Cortex, Sidekiq and live Webpack rebuild via Foreman with the dev-server script:
1
$ bin/dev-server
Copied!
The admin interface should now be accessible locally at http://localhost:3000. To access Cortex as superadmin, login as [email protected] with password welcome1.
Last modified 3yr ago