Getting Started with Docker

Goal: Install Docker on the server and make a container available behind a reverse proxy.

Hint

If you have any questions or feedback, don’t hesitate to contact us.

Create Environment

First you have to create a website on your server. A website acts as a reverse proxy and install Docker for you. Every website is type and environment based which means you have to select a particular type (e.g. docker) and environment (e.g. PROD).

  1. Log in to cockpit.opsone.ch

  2. Choose your server or create a new one

  3. Go to websites, and create a new one

  4. Select website type docker and fill in all settings

According those settings, our automation will setup the server/vhost as required.

Access with SSH

On the server you can work with SSH. Due to security reasons, we allow key based logins only.

  1. If you don’t have an SSH key: Create an SSH key pair

  2. Add your SSH Public Key in the Cockpit: Either for the whole server or within the website.

  3. Now you can log in via SSH. Username is your chosen website name, not your own Username.

Hint

Wondering why your existing SSH key is not working? Maybe it does not meet our minimum requirements

Run a Docker Image

# run your docker container (nginx as example)
$ docker run --detach --restart always --publish 127.0.0.1:8080:80 nginx

You can use any free port. In this example we expose our docker container at 127.0.0.1.8080.

Hint

For the container to be accessible from the outside via reverse proxy, the selected port must match the one in the cockpit.