How To Install: CodiMD
Last updated on: 08-28-2019
System Requirements
This guide assumes your system has the following configuration
- Operating System: Centos 7.6
Disclaimer:
This is not meant to be a comprhensive guide. It's designed to give you enough information to get up and running.
It's your job to put in place security and best practices.
How to install it...
I always reccomend that you understand in a general sense what every command you enter into your system does. Right now you don't a PhD in Linux you just want the answer so open a terminal and here goes...
Step 1
Let's install the required packages.
- yum-utils
- device-mapper-persistent-data
- lvm2
- screen
- epel-release
- git
We do that by issuing the following command inside your terminal.
yum install -y yum-utils device-mapper-persistent-data git lvm2 screen epel-release
Step 2
Now that all of the software we need is installed, let's add the docker repo.
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Step 3
Now that we have both the epel release and the docker repo, let's go ahead and install docker-ce and the rest of the software we will need from these repos.
yum -y install docker-ce python-pip
Step 4
We will use SystemD to start the docker service and command System D to start the docker when the server boots.
systemctl start docker
systemctl enable docker
Step 5
Use pip to install docker compose
pip install docker-compose
Step 6
Let's use git to download the latest copy of CodiMD
git clone https://github.com/hackmdio/docker-hackmd.git
Step 7
We finish the install by moving into the directory and starting the container
cd docker-hackmd
docker-compose up
How to Use it
Step 8
Open a browser to the IP address or FQDN of your CodiMD server on port 3000.
Example: http://codimd.linuxhq.io:3000
You will be greated with the CodiMD landing page.
Step 9
Click on Sign in
Step 10
This is the first time anyone has used this system we will need to create an account. Enter your email, choose a password, then click on the "Register" tab at the bottom of the authentication prompt.
Step 11
An account has been created for you. Now we can click the sign in and begin using our CodiMD server!
Post Configuration
In the docker-hackermd folder you will find the docker-compose.yml file.
If you want your CodiMD server to run on port 80 so a :3000 is nore required, open the docker-compose.yml file
Towards the bottom you will find a ports section that looks similar to this...
ports:
# Ports that are published to the outside.
# The latter port is the port inside the container. It should always stay on 3000
# If you only specify a port it'll published on all interfaces. If you want to use a
# local reverse proxy, you may want to listen on 127.0.0.1.
# Example:
# - "127.0.0.1:3000:3000"
- "3000:3000"
networks:
backend:
restart: always
depends_on:
- database
Change the port to 80, your section should now look like this...
ports:
# Ports that are published to the outside.
# The latter port is the port inside the container. It should always stay on 3000
# If you only specify a port it'll published on all interfaces. If you want to use a
# local reverse proxy, you may want to listen on 127.0.0.1.
# Example:
# - "127.0.0.1:3000:3000"
- "80:3000"
networks:
backend:
restart: always
depends_on:
- database
Install Notes
Pro-Tip: Run CodiMD in a screen session and you can easily connect and disconnect from a persistent CodiMD session.