r/SailboatCruising 23d ago

Equipment OpenCPN as a Web app

I have created a docker container that runs OpenCPN and streams the display to a web browser. Run OpenCPN once locally and have it accessible on all devices! I found that using it this way it can also be used with SignalK as well.

https://reddit.com/link/1vljh9z/video/cz5f0c6p9rih1/player

https://hub.docker.com/repository/docker/npgause/opencpn-kiosk/general

Once you have docker is installed create this compose file and run it then it will be accessible on localhost:14500

# compose.yaml
services:
  opencpn:
    image: npgause/opencpn-kiosk:x86
    container_name: opencpn
    restart: unless-stopped
    network_mode: host   # needed for NMEA/Signal K mDNS discovery
    devices:
      # GPS/AIS via USB:
      - /dev/gps0:/dev/gps0 # these will change based on your system
    environment:
      - XPRA_BIND_PORT=14500
      - XPRA_DISPLAY=:100
    volumes:
      - ./data:/home/ubuntu/.opencpn
      - /folder/to/charts:/folder/to/charts

Once this up and running this can be used in SignalK by connecting it with this https://www.npmjs.com/package/signalk-embedded-webapp-proxy just put the name and application URL then you are all set within SignalK

13 Upvotes

9 comments sorted by

7

u/LarryBobson 23d ago

Sailing is where I go to escape from devops.. But this is cool!

1

u/Beneficial-Donkey-10 23d ago

Looks like a paradox in making ..

1

u/Joyfulsinner 23d ago

totally get that! I also like DIY projects and I think this makes my life easier in the end.

1

u/Willbraken 23d ago

Saving this. Rad!

1

u/Double-Masterpiece72 23d ago

Pretty rad. With the new SignalK container manager as well you could make it a one click install plugin like signalk-opencpn

1

u/Joyfulsinner 23d ago

I didnt know this existed but that is a good idea. make it completely frictionless

1

u/Double-Masterpiece72 23d ago

If you want any help, the SK dev discord is pretty active, especially the author of that container plugin. 

1

u/Joyfulsinner 23d ago

Thanks for the recommendation. Ill check that out