### Manually Install Cosmos Service (Bash) Source: https://cosmos-cloud.io/docs/index Steps for manually installing Cosmos, including enabling and starting the Avahi daemon, downloading and extracting Cosmos, and installing it as a systemd service. ```bash sudo systemctl enable avahi-daemon sudo systemctl start avahi-daemon cd /path/to/cosmos sudo ./cosmos service install sudo systemctl daemon-reload sudo systemctl start CosmosCloud ``` -------------------------------- ### Install Cosmos Standalone Service (Bash) Source: https://cosmos-cloud.io/docs/index Installs Cosmos as a standalone service using a curl script. It can optionally set HTTP/HTTPS ports and perform a dry run. Dependencies like Snapraid, Avahi, Docker, and Docker-Compose are installed. Firewall setup and service startup are handled automatically. Options to skip Docker or dependency installation, or install a beta version, are available. ```bash # IF YOU NEED TO CHANGE THE PORTS, DO IT BEFORE RUNNING THE COMMAND # You can overwrite any other env var by adding them here export COSMOS_HTTP_PORT=80 export COSMOS_HTTPS_PORT=443 # You can run a dry run to see what will be installed curl -fsSL https://cosmos-cloud.io/get.sh | sudo -E bash -s -- --dry-run # If you are happy with the result, you can run the command curl -fsSL https://cosmos-cloud.io/get.sh | sudo -E bash -s ``` -------------------------------- ### Start and Manage Cosmos Systemd Service (Bash) Source: https://cosmos-cloud.io/docs/index Commands to manage the Cosmos systemd service after manual installation. Includes starting, stopping, restarting, checking the status, and viewing system logs related to the Cosmos service. ```bash sudo systemctl start CosmosCloud sudo systemctl stop CosmosCloud sudo systemctl restart CosmosCloud sudo systemctl status CosmosCloud # If you want to see the system logs sudo journalctl -u CosmosCloud ``` -------------------------------- ### Install Docker on Linux Source: https://cosmos-cloud.io/docs/index Installs Docker on a Linux system using a curl script. This command fetches the official Docker installation script and executes it with root privileges. It's a prerequisite for running Cosmos as a Docker container on Linux. ```bash curl -fsSL https://get.docker.com | sudo sh ``` -------------------------------- ### Install Cosmos Dependencies (Debian/Ubuntu, CentOS, Fedora) Source: https://cosmos-cloud.io/docs/index Installs necessary dependencies for a manual Cosmos installation on different Linux distributions. This includes packages like ca-certificates, openssl, snapraid, curl, unzip, wget, avahi-daemon, and iptables-persistent. ```bash # for debian/ubuntu sudo apt-get update sudo apt-get install -y ca-certificates openssl snapraid curl unzip wget avahi-daemon avahi-utils iptables-persistent # for centos sudo yum install -y ca-certificates openssl snapraid curl unzip wget avahi-daemon iptables-services avahi-tools # for fedora sudo dnf install -y ca-certificates openssl snapraid curl unzip wget avahi-daemon iptables-services avahi-tools ``` -------------------------------- ### Run Cosmos Server Docker Container Source: https://cosmos-cloud.io/docs/index Installs and runs the Cosmos server as a Docker container using the `docker run` command. This method is suitable for direct execution and allows for various configurations such as port mapping and volume mounting. Ensure Docker is installed before running this command. ```bash sudo docker run -d --network host --privileged --name cosmos-server -h cosmos-server --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket -v /:/mnt/host -v /var/lib/cosmos:/config azukaar/cosmos-server:latest ``` -------------------------------- ### View Docker Logs Source: https://cosmos-cloud.io/docs/issues-and-troubleshooting This command allows you to view the logs for the Cosmos server container. This is often the first step in diagnosing any issues with the application. ```bash docker logs cosmos-server ``` -------------------------------- ### Uninstall Cosmos (Bash) Source: https://cosmos-cloud.io/docs/index Removes the Cosmos installation. The first command only uninstalls Cosmos, while the second command (`--full`) also removes all configuration folders. ```bash # Only uninstall curl -fsSL https://cosmos-cloud.io/remove.sh | sudo -E bash -s # Uninstall and remove all configurations folder curl -fsSL https://cosmos-cloud.io/remove.sh | sudo -E bash -s -- --full ``` -------------------------------- ### Configure Cosmos Server with Docker Compose Source: https://cosmos-cloud.io/docs/index Sets up and runs the Cosmos server using a Docker Compose file. This method is ideal for managing multi-container applications and defining services, networks, and volumes declaratively. It's particularly useful when host network mode is not desired or feasible. ```yaml version: '3.7' services: cosmos-server: image: azukaar/cosmos-server:latest container_name: cosmos-server hostname: cosmos-server restart: always privileged: true volumes: - /var/run/docker.sock:/var/run/docker.sock - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket - /:/mnt/host - /var/lib/cosmos:/config network_mode: host ``` -------------------------------- ### View Cosmos Logs (Bash) Source: https://cosmos-cloud.io/docs/index Provides commands to view Cosmos logs. The `cosmos.log` file contains formatted logs, while `cosmos.plain.log` contains unformatted logs. `cat` displays the entire file, and `tail -f` can be used for live monitoring. ```bash # If you want to see the Cosmos logs (use more for scroll, or tail -f for live logs) cat /var/lib/cosmos/cosmos.log # If you want to see the plain logs (without the terminal formatting) cat /var/lib/cosmos/cosmos.plain.log ``` -------------------------------- ### Configure Docker for IPv6 in Cosmos Cloud Source: https://cosmos-cloud.io/docs/other-setups This configuration enables IPv6 support for Docker, which is necessary for Cosmos Cloud to function correctly on IPv6 networks. It involves editing the Docker daemon configuration file and specifying an IPv6 network range. ```json { "ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64" } ``` -------------------------------- ### Manually Use Restic with Rclone Integration Source: https://cosmos-cloud.io/docs/backups This command structure allows for manual management of Restic backups when integrated with Rclone. It requires setting the RESTIC_PASSWORD and specifying the desired Restic operation. The rclone arguments configure Restic to use Rclone for remote storage access. ```bash RESTIC_PASSWORD=_PASSWORD_ ./restic _OPERATION_ -o rclone.program="./cosmos" -o rclone args="rclone serve --config=/var/lib/cosmos/rclone.conf restic --stdio --b2-hard-delete --verbose" --repo "/path/to/repo" ``` -------------------------------- ### Cosmos-Compose Data Structures (Go) Source: https://cosmos-cloud.io/docs/cosmos-compose Defines the Go data structures for Cosmos-Compose files, including service configurations, volumes, and networks. These structures mirror Docker-Compose but include Cosmos-specific extensions. ```go type DockerServiceCreateRequest struct { Services map[string]ContainerCreateRequestContainer `json:"services"` Volumes []ContainerCreateRequestVolume `json:"volumes"` Networks map[string]ContainerCreateRequestNetwork `json:"networks"` } type ContainerCreateRequestContainer struct { Name string `json:"container_name"` Image string `json:"image"` Environment []string `json:"environment"` Labels map[string]string `json:"labels"` Ports []string `json:"ports"` Volumes []mount.Mount `json:"volumes"` Networks map[string]struct { Aliases []string `json:"aliases,omitempty"` IPV4Address string `json:"ipv4_address,omitempty"` IPV6Address string `json:"ipv6_address,omitempty"` } `json:"networks"` Routes []utils.ProxyRouteConfig `json:"routes"` RestartPolicy string `json:"restart,omitempty"` Devices []string `json:"devices"` Expose []string `json:"expose"` DependsOn []string `json:"depends_on"` Tty bool `json:"tty,omitempty"` StdinOpen bool `json:"stdin_open,omitempty"` Command string `json:"command,omitempty"` Entrypoint string `json:"entrypoint,omitempty"` WorkingDir string `json:"working_dir,omitempty"` User string `json:"user,omitempty"` Hostname string `json:"hostname,omitempty"` Domainname string `json:"domainname,omitempty"` MacAddress string `json:"mac_address,omitempty"` Privileged bool `json:"privileged,omitempty"` NetworkMode string `json:"network_mode,omitempty"` StopSignal string `json:"stop_signal,omitempty"` StopGracePeriod int `json:"stop_grace_period,omitempty"` HealthCheck struct { Test []string `json:"test"` Interval int `json:"interval"` Timeout int `json:"timeout"` Retries int `json:"retries"` StartPeriod int `json:"start_period"` } `json:"healthcheck,omitempty"` DNS []string `json:"dns"` DNSSearch []string `json:"dns_search"` ExtraHosts []string `json:"extra_hosts"` Links []string `json:"links"` SecurityOpt []string `json:"security_opt"` StorageOpt map[string]string `json:"storage_opt"` Sysctls map[string]string `json:"sysctls"` Isolation string `json:"isolation"` CapAdd []string `json:"cap_add,omitempty"` CapDrop []string `json:"cap_drop,omitempty"` SysctlsMap map[string]string `json:"sysctls,omitempty"` } type ContainerCreateRequestVolume struct { // name must be unique Name string `json:"name"` Driver string `json:"driver"` Source string `json:"source"` Target string `json:"target"` } type ContainerCreateRequestNetwork struct { // name must be unique Name string `json:"name"` Driver string `json:"driver"` Attachable bool `json:"attachable"` Internal bool `json:"internal"` EnableIPv6 bool `json:"enable_ipv6"` IPAM struct { Driver string `json:"driver"` Config []struct { Subnet string `json:"subnet"` } `json:"config"` } `json:"ipam"` } ```