> Versão Markdown de https://yucca.app/pt/docs/install/linux/. Índice da documentação: [llms.txt](https://yucca.app/pt/llms.txt), texto completo em um arquivo: [llms-full.txt](https://yucca.app/pt/llms-full.txt). Qualquer página está disponível como Markdown: adicione `.md` à URL sem a barra final.

# Linux

> **Instalação rápida.** Se a sua distribuição tiver apt, dnf/yum, zypper ou apt-rpm, o script fará a instalação: `curl -fsSL https://releases.yucca.app/get.sh | sh` (para Plus / Enterprise, adicione `--ent`). Abaixo está descrita a instalação manual a partir do arquivo, adequada para qualquer sistema.

Para instalar em qualquer sistema Linux (Arch Linux, NixOS, Alpine Linux e outros), execute os seguintes comandos no terminal:

## Instalação

**Yucca Free**

**AMD64**

```shell
sudo mkdir -p /opt/yucca/ffmpeg
cd /opt/yucca
YUCCA_VER=$(curl -sSLf https://releases.yucca.app/latest/VERSION.txt)
sudo wget https://releases.yucca.app/latest/yucca_linux_amd64.tar.gz
sudo wget https://releases.yucca.app/latest/yucca_${YUCCA_VER}_checksums.txt
sha256sum -c yucca_${YUCCA_VER}_checksums.txt --ignore-missing
sudo tar -xzvf yucca_linux_amd64.tar.gz
sudo rm -f yucca_linux_amd64.tar.gz yucca_${YUCCA_VER}_checksums.txt

```

**ARM64**

```shell
sudo mkdir -p /opt/yucca/ffmpeg
cd /opt/yucca
YUCCA_VER=$(curl -sSLf https://releases.yucca.app/latest/VERSION.txt)
sudo wget https://releases.yucca.app/latest/yucca_linux_arm64.tar.gz
sudo wget https://releases.yucca.app/latest/yucca_${YUCCA_VER}_checksums.txt
sha256sum -c yucca_${YUCCA_VER}_checksums.txt --ignore-missing
sudo tar -xzvf yucca_linux_arm64.tar.gz
sudo rm -f yucca_linux_arm64.tar.gz yucca_${YUCCA_VER}_checksums.txt

```

**ARM**

```shell
sudo mkdir -p /opt/yucca/ffmpeg
cd /opt/yucca
YUCCA_VER=$(curl -sSLf https://releases.yucca.app/latest/VERSION.txt)
sudo wget https://releases.yucca.app/latest/yucca_linux_arm.tar.gz
sudo wget https://releases.yucca.app/latest/yucca_${YUCCA_VER}_checksums.txt
sha256sum -c yucca_${YUCCA_VER}_checksums.txt --ignore-missing
sudo tar -xzvf yucca_linux_arm.tar.gz
sudo rm -f yucca_linux_arm.tar.gz yucca_${YUCCA_VER}_checksums.txt

```

**Yucca Plus / Enterprise**

**AMD64**

```shell
sudo mkdir -p /opt/yucca/ffmpeg
cd /opt/yucca
YUCCA_VER=$(curl -sSLf https://releases.yucca.app/latest/VERSION.txt)
sudo wget https://releases.yucca.app/latest/yucca-ent_linux_amd64.tar.gz
sudo wget https://releases.yucca.app/latest/yucca_${YUCCA_VER}_checksums.txt
sha256sum -c yucca_${YUCCA_VER}_checksums.txt --ignore-missing
sudo tar -xzvf yucca-ent_linux_amd64.tar.gz
sudo rm -f yucca-ent_linux_amd64.tar.gz yucca_${YUCCA_VER}_checksums.txt

```

**ARM64**

```shell
sudo mkdir -p /opt/yucca/ffmpeg
cd /opt/yucca
YUCCA_VER=$(curl -sSLf https://releases.yucca.app/latest/VERSION.txt)
sudo wget https://releases.yucca.app/latest/yucca-ent_linux_arm64.tar.gz
sudo wget https://releases.yucca.app/latest/yucca_${YUCCA_VER}_checksums.txt
sha256sum -c yucca_${YUCCA_VER}_checksums.txt --ignore-missing
sudo tar -xzvf yucca-ent_linux_arm64.tar.gz
sudo rm -f yucca-ent_linux_arm64.tar.gz yucca_${YUCCA_VER}_checksums.txt

```

**ARM**

```shell
sudo mkdir -p /opt/yucca/ffmpeg
cd /opt/yucca
YUCCA_VER=$(curl -sSLf https://releases.yucca.app/latest/VERSION.txt)
sudo wget https://releases.yucca.app/latest/yucca-ent_linux_arm.tar.gz
sudo wget https://releases.yucca.app/latest/yucca_${YUCCA_VER}_checksums.txt
sha256sum -c yucca_${YUCCA_VER}_checksums.txt --ignore-missing
sudo tar -xzvf yucca-ent_linux_arm.tar.gz
sudo rm -f yucca-ent_linux_arm.tar.gz yucca_${YUCCA_VER}_checksums.txt

```

Gere o arquivo de configuração com os valores padrão:

```shell
sudo /opt/yucca/yucca server --config emtpy --show-config | sed 's|data_dir = ""|data_dir = "/opt/yucca/data"|' > /opt/yucca/yucca.toml

```

Crie o usuário e defina o proprietário e as permissões de acesso:

```shell
sudo groupadd --gid 642 --force yucca
sudo useradd --system -u 642 --no-create-home --shell /bin/false --home-dir /opt/yucca --gid yucca yucca
sudo chown -R yucca:yucca /opt/yucca
sudo chmod -R 2775 /opt/yucca

```

### Inicialização automática com Systemd

> **Observação.** Usado na maioria das distribuições populares, como Debian, RHEL e SUSE

Crie um arquivo unit do systemd:

```bash
sudo tee /lib/systemd/system/yucca.service <<EOF
[Unit]
Description=Yucca https://yucca.app
Documentation=https://docs.yucca.app
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=simple
User=yucca
Group=yucca
SyslogIdentifier=yucca
PIDFile=/run/yucca.pid
LimitNOFILE=1024
WorkingDirectory=/opt/yucca
ExecStart=/opt/yucca/yucca server --config /opt/yucca/yucca.toml
ExecStop=/bin/kill -s SIGTERM $MAINPID
Restart=on-failure
RestartSec=10s

[Install]
WantedBy=multi-user.target
EOF


```

Inicie o servidor e verifique o funcionamento:

```bash
sudo systemctl daemon-reload
sudo systemctl enable --now yucca

```

### Inicialização automática com OpenRC

> **Observação.** Usado, por exemplo, no Gentoo

1. Crie um arquivo chamado `yucca` sem extensão no diretório `/etc/init.d/`.
2. Copie o código do script de inicialização para esse arquivo.

```shell
#!/sbin/openrc-run

name="yucca"
command="/opt/yucca/yucca"
command_args="server --config /opt/yucca/yucca.toml"
pidfile="/run/yucca.pid"
output_log="/var/log/yucca.log"

# Устанавливаем ulimit
ulimit -n 1024

depend() {
    need syslog net
}

start_pre() {
    # Создаем каталог для PID-файла
    checkpath --directory --owner yucca:yucca --mode 0755 $(dirname ${pidfile})
}

start() {
    ebegin "Starting ${name}"
    # Запускаем yucca с указанными параметрами
    start-stop-daemon --start --background \
        --make-pidfile --pidfile ${pidfile} \
        --chuid yucca:yucca \
        --exec ${command} -- ${command_args} >> ${output_log} 2>&1
    eend $?
}

stop() {
    ebegin "Stopping ${name}"
    # Останавливаем yucca
    start-stop-daemon --stop --quiet --pidfile ${pidfile}
    eend $?
}

restart() {
    svc_stop
    svc_start
}

```

3. Certifique-se de que o script tenha permissão de execução, usando o comando `chmod +x /etc/init.d/yucca`.
4. Adicione o script à inicialização automática executando `rc-update add yucca default`.
5. Agora você pode gerenciar o serviço com os seguintes comandos:

* `rc-service yucca start` — Inicia o serviço.
* `rc-service yucca stop` — Para o serviço.
* `rc-service yucca restart` — Reinicia o serviço.
* `rc-service yucca status` — Verifica o status do serviço.

### Inicialização automática com Upstart

> **Observação.** Usado, por exemplo, no Synology NAS

Crie um script de inicialização automática do Upstart init:

```sh
sudo tee /etc/init/yucca.conf <<EOF
description "Yucca https://yucca.app"
author "Yucca"

start on filesystem or runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 10 10
setuid yucca
setgid yucca
chdir /opt/yucca
limit nofile 1024 1024
script
    exec /opt/yucca/yucca server --config /opt/yucca/yucca.toml
end script

EOF

```

Atualize a configuração do Upstart e inicie o serviço:

```sh
sudo initctl reload-configuration
sudo initctl start yucca

```

## Verificação do funcionamento

Após a instalação e inicialização, a interface web estará disponível em **<http://ip-do-seu-servidor:9910>**. Se a interface não estiver disponível após a instalação, verifique o status do serviço e consulte os logs do servidor.

## Atualização

Baixe o arquivo mais recente (veja a seção «Instalação» acima), extraia-o sobre o diretório `/opt/yucca` e reinicie o serviço — por exemplo, para o systemd:

```shell
sudo systemctl restart yucca

```

Para o OpenRC use `sudo rc-service yucca restart`, para o Upstart — `sudo initctl restart yucca`.

## Remoção

```shell
sudo systemctl disable --now yucca
sudo rm -rf /opt/yucca
sudo userdel yucca
sudo groupdel yucca

```
