Portainer Templates logo

Portainer Templates

Anyviz Cloud Adaptor Anyviz Cloud Adaptor

edge

The cloud adapter connects local devices via OPC-UA, Modbus, Siemens, Beckhoff ADS, EtherNet/IP, M-Bus and BACnet to the AnyViz Cloud.

Image details

Pulls: 52.7k
Architectures: amd64, arm64, arm/v7, 386, arm64/v8
Image size: 5 MB
Latest: 2.1.3.2
User: anyviz
Created: Sep 05, 2019
Updated: 1 month ago
Status: active

Configuration

Type
Compose
Platform
linux
Image
anyviz/cloudadapter
Ports
8888:8888
Volumes
/etc/anyviz : anyviz_config
Restart
always
Source

Template by portainer·Source

Installation

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select the app you wish to deploy, fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo

docker run -d --name cloudadapter \
  -p 8888:8888 \
  -v anyviz_config:/etc/anyviz \
  --restart=always \
  anyviz/cloudadapter

If the stack expects env vars, set them or add them to a .env file first.

version: "2"
services:
  cloudadapter:
    image: anyviz/cloudadapter
    restart: always
    ports:
      - "8888:8888"
    volumes:
      - anyviz_config:/etc/anyviz
    network_mode: "host"
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
volumes:
  anyviz_config:

Or, use the original compose file, straight from the template repo. Deploy with:

git clone https://github.com/portainer/templates
cd templates
docker compose -f edge/anyviz/docker-compose.yml up -d

Save this file as anyviz-cloud-adaptor-stack.yml, then from a manager node, run docker stack deploy -c anyviz-cloud-adaptor-stack.yml anyviz-cloud-adaptor

version: '3.8'
services:
  anyviz-cloud-adaptor:
    image: anyviz/cloudadapter
    ports:
      - '8888:8888'
    volumes:
      - anyviz_config:/etc/anyviz
    deploy:
      restart_policy:
        condition: any

Save each file below into a folder, then run kubectl apply -f .
Written for k3s, but works on any cluster: bind mounts use hostPath, named volumes get a persistent volume claim, and ports are exposed via a LoadBalancer service.

anyviz-cloud-adaptor-deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: anyviz-cloud-adaptor
  labels:
    app: anyviz-cloud-adaptor
spec:
  replicas: 1
  selector:
    matchLabels:
      app: anyviz-cloud-adaptor
  template:
    metadata:
      labels:
        app: anyviz-cloud-adaptor
    spec:
      containers:
        - name: anyviz-cloud-adaptor
          image: anyviz/cloudadapter
          ports:
            - containerPort: 8888
              protocol: TCP
          volumeMounts:
            - name: anyviz-cloud-adaptor-data-0
              mountPath: /etc/anyviz
      volumes:
        - name: anyviz-cloud-adaptor-data-0
          hostPath:
            path: anyviz_config

anyviz-cloud-adaptor-service.yaml

apiVersion: v1
kind: Service
metadata:
  name: anyviz-cloud-adaptor
spec:
  type: LoadBalancer
  selector:
    app: anyviz-cloud-adaptor
  ports:
    - name: 8888-tcp
      port: 8888
      targetPort: 8888
      protocol: TCP

Save this file as ~/.config/containers/systemd/anyviz-cloud-adaptor.container

[Unit]
Description=Anyviz Cloud Adaptor

[Container]
Image=anyviz/cloudadapter
ContainerName=anyviz-cloud-adaptor
PublishPort=8888:8888
Volume=anyviz_config:/etc/anyviz

[Service]
Restart=always

[Install]
WantedBy=default.target

Then reload systemd and start the service:

systemctl --user daemon-reload
systemctl --user start anyviz-cloud-adaptor

For a system-wide service, use /etc/containers/systemd/ and drop --user.

For more installation options, see the Documentation in our GitHub repo

What is AnyViz

The AnyViz cloud solution allows you to remotely monitor, control and analyse industrial PLCs, sensors and meters.

What are the features of anyviz/cloudadapter

The cloud adapter is able to connect local devices via OPC-UA, Modbus, Siemens, Beckhoff ADS, EtherNet/IP, M-Bus and BACnet. The data is collected locally and transmitted to the AnyViz portal via an encrypted connection. If the internet connection is interrupted, the data is buffered locally. In addition, the Cloud Adapter can pass through local websites and VNC servers so that they can be embedded in the Cloud HMI.

Running AnyViz cloud adapter

~ docker run -d -p 80:8888 -p 9999:9999 anyviz/cloudadapter ~ Open your browser (port 80) and start configuring via web interface.

Running AnyViz cloud adapter including full AnyViz VPN support

~ docker run -d --net=host --cap-add=NETADMIN --device /dev/net/tun:/dev/net/tun anyviz/cloudadapter ~ The AnyViz Cloud Adapter requires some privileges to enable VPN connections.

Running AnyViz cloud adapter via docker-compose

Create a directory (e.g. ./anyvizcloudadapter) and create a file named docker-compose.yml with following content.
~ version: "2" services: cloudadapter:
image: anyviz/cloudadapter
restart: always
container_name: anyviz
ports:
  - "8888:8888"
  - "9999:9999"
volumes:
  - anyviz_config:/etc/anyviz
# required if AnyViz VPN is needed
network_mode: "host"
cap_add:
  - NET_ADMIN
devices:
  - /dev/net/tun
volumes: anyviz
config:
~ Start AnyViz cloud adapter by typing docker-compose up -d. Web UI is listening on port 8888 in this case

Complete setup

  1. Join the AnViz portal or create a new project
  2. Enter the project ID given by AnyViz portal and enter a unique password for your cloud adapter setup project ID and password
  3. The cloud adapter should now appear in the AnyViz portal. In the configuration dialog of the Cloud Adapter the password from step 2 has to be confirmed. retype password of cloud adapter

Additional links and documentation

Serve Anyviz Cloud Adaptor on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.

Proxying anyviz-cloud-adaptor.example.com to http://cloudadapter:8888

Add this to your Caddyfile

anyviz-cloud-adaptor.example.com {
	reverse_proxy http://cloudadapter:8888
}

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs <container>
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Port already in use

If deployment fails with "Bind for 0.0.0.0:8888 failed: port is already allocated", something else on your server is using that port.

  • Find what's using it: sudo ss -tlnp | grep :8888
  • Stop the other service, or pick a different host port. In 8888:8888 only the left number is yours to change, the right one belongs to the app.

Running but the page won't load

The container is up but nothing appears in your browser.

  • Use your server's real IP: http://your-server-ip:8888. The 0.0.0.0 link Portainer shows isn't a real address.
  • Give it a minute after first deploy, cloudadapter can take a while to initialise.
  • Make sure your firewall allows the port, e.g. sudo ufw allow 8888

Image won't pull

Test the pull directly on the host: docker pull anyviz/cloudadapter

  • "manifest unknown" means the tag no longer exists. This template uses latest, so try pinning a specific version instead.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • This image supports: amd64, arm64, arm/v7, 386, arm64/v8
  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Container keeps restarting

The always restart policy relaunches the app after every crash, so the real error can scroll past.

  • Check the logs right after a restart, the last few lines before it died are the useful ones.
  • Get the exit code with docker inspect <container> --format '{{.State.ExitCode}}'
  • Still stuck? Redeploy once with the restart policy set to no so the failure stays visible.

Stack won't deploy

Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.

  • YAML only accepts spaces for indentation, a single tab breaks the whole file.

Raise an issue

Found something which isn't working as it should? Here's how to report it.

Similar apps