Cody CMS
Fork me on GitHub

Install your own Cody


Using npm


  • Install nodejs and mysql
  • Create a new directory for your cms and navigate to it (in unix):

      $ mkdir codysites
      $ cd codysites
  • Install cody and its dependencies

      $ npm install cody
  • Set up a new web site using the guided scaffolding

      $ node ./node_modules/cody/bin/create_site.js 
    Creating project in  /Users/johan/codysites/
    1) Enter projectname: firstApp
    Note: also using firstApp as database name.
    Note: by default the mysql root user has no password so you can just hit enter, if you forgot the root password
    2) Enter root password for mysql so we can create a new database and user: xxxxx
    3) Enter site database user: firstUser
    4) Enter site database password: firstPW
    5) Enter hostname for site: first
    6) Enter a location for storing documents: /usr/local/data/first
      [ windows users could use something like C:\documents\first ]
      [ *nix users without write permission in /usr/local for example: /home/billgates/cody/data ] 
    mkdir /Users/johan/codysites/firstApp/static
    mkdir /Users/johan/codysites/firstApp/static/css
    mkdir /Users/johan/codysites/firstApp/static/images
    mkdir /Users/johan/codysites/firstApp/static/js
    mkdir /Users/johan/codysites/firstApp/views
    created /usr/local/data/first/
    created /usr/local/data/first/images
    created /usr/local/data/first/files
    Site 'firstApp' has been prepared.
    Please create DNS entries, or add to /etc/hosts:     first
    Also check index.js and config.json to fine-tune extra parameters, encryption key, ...
    Start your site using:
    $ forever start firstApp.js
    $ node firstApp.js
  • Go to "http://firstApp:3001" to see your current site and go to "http://firstApp:3001/en/dashboard" to see the CMS of the site.

    the default users are: 'super', 'admin', 'test' and 'user' which all have password 'empty'


Installing from source [outdated]


- unpack zip

# download the zipfile from our homepage containing our latest release
cd cody


substitute the name of your project/website for "mysite" in the rest of the page.

- create database + load initial content 

# create a database and user for your wesite (feel free to use a different user)
mysql -e "create database mysite default charset utf8"
mysql -e "grant all on mysite.* to 'cody'@'%' identified by 'ydoc'"
mysql -e "grant all on mysite.* to 'cody'@'localhost' identified by ydoc"
# now load all the initial content
mysql -u cody -p ydoc mysite < setup.sql


- install node.js

# download the latest version from
# follow the instructions


- install needed packages

# in the directory where you installed cody
# normally the node_modules are present in the release file

npm install express
npm install ejs
npm install mime
npm install mysql
npm install simplesmtp
npm install nodemailer
npm install forever -g


- create a dns name to use

# add to your /etc/hosts (or other) file an entry as below       mysite.local

# or create an A or CNAME record for on the dns server of with the IP address of the machine where you are installing the instance of Cody


- startup script parameters + forever start index.js

# personalise and run the startup script: edit index.js
# change the database user and password if wanted.
# if you don't have access to your own domain + dns server # add "local.mysql" to your /etc/hosts file pointing to # cody.startWebApp(cody.server, { # "name": "mysite", # "version": "v1.0a1", # "defaultlanguage": "en", # "hostnames" : ",,local.mysite", # "dbuser": "cody", # "dbpassword": "ydoc", # "dbhost": "localhost", # "datapath": "/usr/local/data/mysite", # "db": mysite, # "controllers": require("./mysite/controllers/") # }, ...); forever start index.js

In the users table of the created database / cms, we've created 3 users: rsuper, radmin and rtest, each with the password "ydoc", you can use these to create new users and to test the different user levels.

For running multiple Cody websites in http and https with multiple virtual hosts... See the "how to" section.