How To Install: CodiMD
Last updated on: 08-28-2019
This guide assumes your system has the following configuration
- Operating System: Centos 7.6
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...
Let's install the required packages.
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
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
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
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
Use pip to install docker compose
pip install docker-compose
Let's use git to download the latest copy of CodiMD
git clone https://github.com/hackmdio/docker-hackmd.git
We finish the install by moving into the directory and starting the container
How to Use it
Open a browser to the IP address or FQDN of your CodiMD server on port 3000.
You will be greated with the CodiMD landing page.
Click on Sign in
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.
An account has been created for you. Now we can click the sign in and begin using our CodiMD server!
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
Pro-Tip: Run CodiMD in a screen session and you can easily connect and disconnect from a persistent CodiMD session.