Readme - Deployify server for Docker on Ubuntu

Docker is an engine that runs applications inside isolated containers. No OS littering and very easy to update without thinking of dependencies.

Think of it as popping in a CD/DVD in your computer. You can easily just remove the CD/DVD and knowing everything on the CD/DVD is removed from the computer. It's easy, right? Docker works in a similar way.

The installation script will install Docker for you.

You can run Docker on Windows too, with Docker Desktop and WSL. But that should only be for testing Deployify.

Deployify no longer support Windows 7 due to a new library that use the native WebSocket namespace, which is not exposed on Windows 7.
 

Preparations:

  • Get a domain.
  • Add these subdomains and point them to your internet IP address:
    app.{domain}
    api.{domain}
  • In your router, forward port 80, 81, and 443 to your server IP address.

 

Installation:
 

sudo curl -L https://raw.githubusercontent.com/deployify/install-docker/master/extractor.txt | sudo bash -s {domain}


Example:

sudo curl -L https://raw.githubusercontent.com/deployify/install-docker/master/extractor.txt | sudo bash -s deployify.io


And if you want to include a web portal (Portainer) to manage Docker (not needed):

sudo curl -L https://raw.githubusercontent.com/deployify/install-docker/master/extractor.txt | sudo bash -s deployify.io management

This is the address to the management portal: http://localhost:9000


There is no problem to run the install script multiple times, even with different domain parameters (e.g if you misstyped the first time).

Yeah, that's it. Like magic.

 

Now what?
 

Your data lives here:

/var/lib/deployify


 

SSL:

If all is good and the domain is reachable from internet, then the proxy container will attempt to generate the SSL certificates for the subdomains listed in the preparations section.


Backup and restore:

 

First, make sure that you have the latest backup binary.

cd /var/lib/deployify/
curl -L github.com/deployify/install-docker/raw/master/backup-linux -o backup-linux

 

Backup:

sudo /var/lib/deployify/backup-linux backup {output}


Restore:
Always install Deployify properly before restoring a backup.

sudo /var/lib/deployify/backup-linux restore {input}

 

Restore a backup that comes from some of the other installation alternatives, like Windows (migrate to the newer database engine):
 

  1. Restore the backup, and then wait about one minute before proceeding to the next step.
  2. Stop DB container and API container.
    sudo docker stop deployify_neo4j 
    sudo docker stop deployify_api
    
  3. Download the migration script (anywhere), and run the script. Wait until the database is migrated and started (will be printed out).
    curl -L https://raw.githubusercontent.com/deployify/install-docker/master/scripts/migrate_neo4j_4.0.0.sh -o migration.sh
    sudo chmod 700 ./migration.sh
    sudo ./migration.sh
    
  4. Press ctrl+c to end the script. Now, run the initiation script.
    cd /var/lib/deployify/scripts
    sudo ./init.sh
    

 

Done.


Auto update:

The host is running a script once every 24/h that pulls Deployify images from the Docker hub (only downloading if a new is found), and if a new image was pulled, an initiation script executes. The initiation script is named init.sh and reloads the docker containers for Deployify. The script can be found here:

/var/lib/deployify/scripts/init.sh


This feature only updates the Docker images and reloads the containers, but does not perform a full installation like the installation script does. It can be a problem if a script has changed that reloads the containers for example, and in that case, you have to rerun the installation script. It ensures that all files are properly updated, and not only the images. As stated before, there is no problem to rerun the installation script as  many times as you want.


An automated backup is always performed before updating the Deployify containers, and can be found here:

/var/lib/deployify/backups


You can disable the auto update service with this command:

sudo systemctl stop deployify-updater
sudo systemctl disable deployify-updater


This script is looking for updates and is triggered by the auto update service above:

/var/lib/deployify/scripts/auto_updater.sh

 

Global settings:

To change the global server settings, you first have to claim the global admin role. Read more here.

Global admin:

  1. Sign in.
  2. Click on "Global settings".
  3. Claim the global admin role.
  4. Sign out and in again.

Now you are able to change global server settings.
 

Unseal Vault from Deployify website manually:

First, enable this feature in the global settings. Then move the key file to a safe location (not on the server).

/var/lib/deployify/data/vault/keys.json

 

The keys.json file will look something like this inside:
["asd98er0rt908df09ds09sdf", "12390a8sd90re908waasd098", "sad45fdewr897e89ga", "54098etrgfbv09834"]

Take each key (without quotations) and paste them in the form. Every key should be on its own row, so hit enter after each key you paste.

Like this:
asd98er0rt908df09ds09sdf
12390a8sd90re908waasd098
sad45fdewr897e89ga
54098etrgfbv09834

Then click "Unseal".

Uninstallation:


Stop auto updater and remove Deployify from Docker:

# stop auto updater
sudo systemctl stop deployify-updater
# disable auto updater
sudo systemctl disable deployify-updater
# stop all deployify containers
sudo docker stop deployify_api
sudo docker stop deployify_site
sudo docker stop deployify_proxy
sudo docker stop deployify_neo4j
sudo docker stop deployify_vault
sudo docker stop deployify_management
# clean all deployify related from docker
sudo docker prune --filter "label!=deployify"


Remove all Deployify data, including backups:

# WARNING! this will delete all deployify data, including automatic backups
sudo rm -r /var/lib/deployify