> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/es/configuracion/overleaf-toolkit/s3.md).

# S3

{% hint style="info" %}
Este documento cubre la configuración de S3 en Server CE y Overleaf Pro. Un [guía aparte](/on-premises/es/mantenimiento/s3-migration.md) se puede encontrar sobre la migración de datos existentes a almacenamiento compatible con S3.
{% endhint %}

## Cuándo considerar el uso de S3 para el almacenamiento de datos

Para instancias con menos de 1000 asientos, recomendamos usar almacenamiento en disco local con copias de seguridad regulares [consistentes](https://docs.overleaf.com/on-premises/maintenance/data-and-backups#performing-a-consistent-backup).

Para instancias más grandes, con más de 1000 asientos, que alcanzan los límites de su almacenamiento local (tamaño o rendimiento), recomendamos usar un backend de almacenamiento de objetos compatible con S3 en lugar de otras soluciones de almacenamiento basadas en red, como NFS.

## Opciones de almacenamiento de objetos compatibles con S3

Estas son las opciones más populares de almacenamiento de objetos compatible con S3:

* [AWS S3](https://aws.amazon.com/s3/), administrado, sugerimos elegir AWS S3 al ejecutar Overleaf CE/Server Pro en AWS
* [MINIO](https://min.io/), autohospedado
* [Ceph](https://ceph.io/en/), autohospedado
* Otros proveedores de alojamiento también tienen algún tipo de almacenamiento de objetos compatible con S3 administrado; quizá quieras usarlo en lugar de ejecutar el tuyo propio cuando ya estés ejecutando Overleaf CE/Server Pro en un proveedor así.

## Consideraciones de latencia al elegir un almacenamiento de objetos compatible con S3

La latencia entre la instancia de Server CE/Server Pro y tu almacenamiento de objetos compatible con S3 contribuye en gran medida al tiempo que tarda en completarse la migración. La latencia también afecta al rendimiento de carga de archivos en Server CE/Server Pro, y las descargas lentas de archivos también pueden tener un gran impacto en los tiempos de compilación de PDF. Sugerimos minimizar la distancia geográfica entre tu instancia de Server CE/Server Pro y el almacenamiento de objetos compatible con S3. En un entorno administrado, esto significaría aprovisionar un bucket en la misma región, y para una solución local, ejecutar ambos en el mismo campus.

## Configuración de S3

Necesitamos cuatro "buckets" y dos cuentas de usuario restringidas.

{% hint style="warning" %}
Los buckets deben **no** ser accesibles públicamente
{% endhint %}

<table data-header-hidden><thead><tr><th width="279"></th><th width="152"></th><th width="97"></th><th></th></tr></thead><tbody><tr><td>Bucket</td><td>Uso</td><td>Servicio</td><td>Anteriormente en <code>/var/lib/overleaf/data</code></td></tr><tr><td><code>overleaf-user-files</code></td><td>archivos de usuario del proyecto</td><td>filestore</td><td><code>user_files</code></td></tr><tr><td><code>overleaf-template-files</code></td><td>archivos de plantilla</td><td>filestore</td><td><code>template_files</code></td></tr><tr><td><code>overleaf-project-blobs</code></td><td>blobs del historial del proyecto</td><td>historial y almacén de archivos de solo lectura</td><td><code>history/overleaf-project-blobs</code></td></tr><tr><td><code>overleaf-chunks</code></td><td>fragmentos del historial</td><td>history</td><td><code>history/overleaf-chunks</code></td></tr></tbody></table>

Es posible que quieras o necesites elegir un nombre diferente; asegúrate de usar los buckets personalizados en todos los comandos.

Lo siguiente usará marcadores de posición para las credenciales reales:

<table><thead><tr><th width="431">Variable de entorno</th><th>Descripción</th></tr></thead><tbody><tr><td><code>OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID</code></td><td>La clave de acceso/nombre de usuario del usuario restringido del servicio de filestore.</td></tr><tr><td><code>OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY</code></td><td>La clave secreta/contraseña del usuario restringido del servicio de filestore.</td></tr><tr><td><code>OVERLEAF_HISTORY_S3_ACCESS_KEY_ID</code></td><td>La clave de acceso/nombre de usuario del usuario restringido del servicio de historial.</td></tr><tr><td><code>OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY</code></td><td>La clave secreta/contraseña del usuario restringido del servicio de historial.</td></tr></tbody></table>

Server CE y Server Pro solo necesitan un pequeño conjunto de permisos en cada bucket:

* crear objeto
* obtener objeto
* eliminar objeto
* listar bucket

### Políticas de acceso

Así es como podría verse una política para el usuario de filestore:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket"
      ],
      "Resource": "arn:aws:s3:::overleaf-user-files"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::overleaf-user-files/*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
      ],
      "Resource": "arn:aws:s3:::overleaf-project-blobs/*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket"
      ],
      "Resource": "arn:aws:s3:::overleaf-template-files"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::overleaf-template-files/*"
    }
  ]
}
```

Así es como podría verse una política para el usuario de historial:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket"
      ],
      "Resource": "arn:aws:s3:::overleaf-project-blobs"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::overleaf-project-blobs/*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket"
      ],
      "Resource": "arn:aws:s3:::overleaf-chunks"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::overleaf-chunks/*"
    }
  ]
}
```

### Resumen de variables

#### Al usar AWS S3

```bash
# Habilitar el backend de S3 para filestore
OVERLEAF_FILESTORE_BACKEND=s3

# Nombre del bucket para los archivos del proyecto
OVERLEAF_FILESTORE_USER_FILES_BUCKET_NAME=overleaf-user-files

# Nombre del bucket para los archivos de plantilla
OVERLEAF_FILESTORE_TEMPLATE_FILES_BUCKET_NAME=overleaf-template-files

# Clave para el usuario de filestore
OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID=...

# Secreto para el usuario de filestore
OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY=...

# Región del bucket que elegiste al crear los buckets.
OVERLEAF_FILESTORE_S3_REGION=""

# Habilitar el backend de S3 para historial
OVERLEAF_HISTORY_BACKEND=s3

# Nombre del bucket para los blobs del historial del proyecto
OVERLEAF_HISTORY_PROJECT_BLOBS_BUCKET=overleaf-project-blobs

# Nombre del bucket para los fragmentos del historial
OVERLEAF_HISTORY_CHUNKS_BUCKET=overleaf-chunks

# Clave para el usuario de historial
OVERLEAF_HISTORY_S3_ACCESS_KEY_ID=...

# Secreto para el usuario de historial
OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY=...

# Región del bucket que elegiste al crear los buckets.
OVERLEAF_HISTORY_S3_REGION=""
```

#### Al usar una opción autohospedada

```bash
# Habilitar el backend de S3 para filestore
OVERLEAF_FILESTORE_BACKEND=s3

# Nombre del bucket para los archivos del proyecto
OVERLEAF_FILESTORE_USER_FILES_BUCKET_NAME=overleaf-user-files

# Nombre del bucket para los archivos de plantilla
OVERLEAF_FILESTORE_TEMPLATE_FILES_BUCKET_NAME=overleaf-template-files

# Clave para el usuario de filestore
OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID=...

# Secreto para el usuario de filestore
OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY=...

# Punto final del proveedor S3
OVERLEAF_FILESTORE_S3_ENDPOINT=http://10.10.10.10:9000

# Direccionamiento de buckets con estilo de ruta. Lo más probable es que debas establecer esto en "true".
OVERLEAF_FILESTORE_S3_PATH_STYLE="true"

# Región del bucket. Lo más probable es que no necesites configurarlo.
OVERLEAF_FILESTORE_S3_REGION=""

# Habilitar el backend de S3 para historial
OVERLEAF_HISTORY_BACKEND=s3

# Nombre del bucket para los blobs del historial del proyecto
OVERLEAF_HISTORY_PROJECT_BLOBS_BUCKET=overleaf-project-blobs

# Nombre del bucket para los fragmentos del historial
OVERLEAF_HISTORY_CHUNKS_BUCKET=overleaf-chunks

# Clave para el usuario de historial
OVERLEAF_HISTORY_S3_ACCESS_KEY_ID=...

# Secreto para el usuario de historial
OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY=...

# Punto final del proveedor S3
OVERLEAF_HISTORY_S3_ENDPOINT=http://10.10.10.10:9000

# Direccionamiento de buckets con estilo de ruta. Lo más probable es que debas establecer esto en "true".
OVERLEAF_HISTORY_S3_PATH_STYLE="true"

# Región del bucket. Lo más probable es que no necesites configurarlo.
OVERLEAF_HISTORY_S3_REGION=""
```

### Configuración de MINIO

{% hint style="info" %}
`MINIO_ROOT_USER` y `MINIO_ROOT_PASSWORD` son las credenciales raíz de la instancia de MINIO.
{% endhint %}

Por favor, sigue la [documentación oficial](https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart) para obtener una copia de `mc`.

```bash
mc alias set s3 http://10.10.10.10:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD

# Pon el contenido de las políticas de la sección anterior en el
# archivo json correspondiente policy-filestore.json y policy-history.json.

# Recordatorio: reemplaza los nombres de los buckets y las credenciales en consecuencia.

# buckets, usuario y política de filestore
mc mb --ignore-existing s3/overleaf-user-files
mc mb --ignore-existing s3/overleaf-template-files
mc admin user add s3 \
  OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID \
  OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY
mc admin policy create s3 overleaf-filestore policy-filestore.json
mc admin policy attach s3 overleaf-filestore \
  --user=OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID

# buckets, usuario y política de historial
mc mb --ignore-existing s3/overleaf-project-blobs
mc mb --ignore-existing s3/overleaf-chunks
mc admin user add s3 \
  OVERLEAF_HISTORY_S3_ACCESS_KEY_ID \
  OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY
mc admin policy create s3 overleaf-history policy-history.json
mc admin policy attach s3 overleaf-history \
  --user=OVERLEAF_HISTORY_S3_ACCESS_KEY_ID
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/es/configuracion/overleaf-toolkit/s3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
