Set container hostname

Hello,
I’m wondering how to set the hostname inside a container running on ZimaOS.

Here’s the scenario: I’m running Duplicati in a container on my ZimaBoard with ZimaOS 1.4. The network mode for the Duplicati container is set to Bridge for security reasons. However, this results in the browser tab showing a title like "random_id_code - Duplicati". In contrast, when I launch the Duplicati app on my Mac, the tab shows "My_Mac_name - Duplicati" — which is much clearer.

I’d like to set a more meaningful hostname like "My-Zimaboard" or ideally match the physical machine’s hostname.

I tried setting hostname: My-Zima inside the Docker Compose file, but this seems to have no effect when using the ZimaOS Compose form. Every time I reinstall the app, Duplicati generates a new random ID as hostname.

I also attempted to use an additional argument like --hostname=my-desired-hostname, but that didn’t work either.

Any idea how to solve this?
Is there a way to set the container’s hostname from the GUI installation process provided by ZimaOS?

Thanks in advance!

hostname is a field I would like to see in the container settings (and others).

Therefore I always create compose files (even for ZimaOS) and I do always import them. Even when updating containers.

Did an update wipe the hostname?

Otherwise you could show us your compose file, we can check for errors.

1 Like

It seems the hostname parameter is not preserved when the Compose file is imported via the ZimaOS GUI. Please take a look at the following screenshot from the Duplicati Docker app installation.

Than after import I just see fields title and container namein ZimaOS form

The hostname seems to be lost during the process, as I verified by running docker exec duplicati hostname from the terminal — it returns a randomly auto-assigned code. What I’d like instead is to assign a custom hostname like MY-ZimaBoard_NAME , without having to use host mode in the container’s network settings.
Any suggestions on how to achieve this via the ZimaOS GUI, or if there’s a workaround that still allows bridge mode and hostname customization?

I tested it again, and it works for me:

Even when exporting the compose file, the hostname is still there (and other CasaOS specific stuff is added):

name: soothing_michel
services:
  duplicati:
    cpu_shares: 90
    command: []
    container_name: duplicati
    deploy:
      resources:
        limits:
          memory: 31863M
    hostname: MY-ZimaBoard_NAME
    image: duplicati/duplicati:latest
    labels:
      icon: https://icon.casaos.io/main/all/duplicati.png
    restart: unless-stopped
    ports: []
    volumes: []
    devices: []
    cap_add: []
    environment: []
    network_mode: bridge
    privileged: false
x-casaos:
  author: self
  category: self
  hostname: ""
  icon: https://icon.casaos.io/main/all/duplicati.png
  index: /
  is_uncontrolled: false
  port_map: "8200"
  scheme: http
  store_app_id: soothing_michel
  title:
    custom: ""
    en_us: duplicati

In general, the ZimaOS importer does also respect other invisible compose parameters like:

  • cap_drop
  • labels
  • security_opt
  • stop_grace_period
  • tty
  • ulimits
  • user

It would be nicer to have corresponding fields in the form though. At least hostname.

P.S. If you want somebody else to test your compose files, please provide text instead of a picture for easy copy and paste.