> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-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 plazas, recomendamos usar almacenamiento en disco local con copias de seguridad periódicas [copias de seguridad periódicas](https://docs.overleaf.com/on-premises/maintenance/data-and-backups#performing-a-consistent-backup).

Para instancias más grandes con más de 1000 plazas que alcanzan los límites de su almacenamiento local (tamaño o rendimiento), recomendamos usar un almacenamiento de objetos compatible con S3 en lugar de otras soluciones de almacenamiento 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 cuando ejecute Overleaf CE/Server Pro en AWS
* [MINIO](https://min.io/), autoalojado
* [Ceph](https://ceph.io/en/), autoalojado
* Otros proveedores de alojamiento también tienen algún tipo de almacenamiento de objetos compatible con S3 administrado; quizá prefiera usarlo en lugar de ejecutar el suyo propio cuando ya esté ejecutando Overleaf CE/Server Pro con ese proveedor.

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

La latencia entre la instancia de Server CE/Server Pro y su almacenamiento de objetos compatible con S3 contribuye enormemente 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 su 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>historial</td><td><code>history/overleaf-chunks</code></td></tr></tbody></table>

Es posible que quiera/necesite elegir un nombre diferente; asegúrese de usar los buckets personalizados en todos los comandos.

A continuación se usarán 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 almacén de archivos.</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 almacén de archivos.</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í podría verse una política para el usuario del almacén de archivos:

```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í podría verse una política para el usuario del 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/*"
    }
  ]
}
```

### Descripción general de variables

#### Al usar AWS S3

```bash
# Enable S3 backend for filestore
OVERLEAF_FILESTORE_BACKEND=s3

# Bucket name for project files
OVERLEAF_FILESTORE_USER_FILES_BUCKET_NAME=overleaf-user-files

# Bucket name for template files
OVERLEAF_FILESTORE_TEMPLATE_FILES_BUCKET_NAME=overleaf-template-files

# Key for filestore user
OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID=...

# Secret for filestore user
OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY=...

# Bucket region you picked when creating the buckets.
OVERLEAF_FILESTORE_S3_REGION=""

# Enable S3 backend for history
OVERLEAF_HISTORY_BACKEND=s3

# Bucket name for project history blobs
OVERLEAF_HISTORY_PROJECT_BLOBS_BUCKET=overleaf-project-blobs

# Bucket name for history chunks
OVERLEAF_HISTORY_CHUNKS_BUCKET=overleaf-chunks

# Key for history user
OVERLEAF_HISTORY_S3_ACCESS_KEY_ID=...

# Secret for history user
OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY=...

# Bucket region you picked when creating the buckets.
OVERLEAF_HISTORY_S3_REGION=""
```

#### Al usar una opción autoalojada

```bash
# Enable S3 backend for filestore
OVERLEAF_FILESTORE_BACKEND=s3

# Bucket name for project files
OVERLEAF_FILESTORE_USER_FILES_BUCKET_NAME=overleaf-user-files

# Bucket name for template files
OVERLEAF_FILESTORE_TEMPLATE_FILES_BUCKET_NAME=overleaf-template-files

# Key for filestore user
OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID=...

# Secret for filestore user
OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY=...

# extremo del proveedor de S3
OVERLEAF_FILESTORE_S3_ENDPOINT=http://10.10.10.10:9000

# direccionamiento de buckets con estilo de ruta. Lo más probable es que tenga que configurarlo en "true".
OVERLEAF_FILESTORE_S3_PATH_STYLE="true"

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

# Enable S3 backend for history
OVERLEAF_HISTORY_BACKEND=s3

# Bucket name for project history blobs
OVERLEAF_HISTORY_PROJECT_BLOBS_BUCKET=overleaf-project-blobs

# Bucket name for history chunks
OVERLEAF_HISTORY_CHUNKS_BUCKET=overleaf-chunks

# Key for history user
OVERLEAF_HISTORY_S3_ACCESS_KEY_ID=...

# Secret for history user
OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY=...

# extremo del proveedor de S3
OVERLEAF_HISTORY_S3_ENDPOINT=http://10.10.10.10:9000

# direccionamiento de buckets con estilo de ruta. Lo más probable es que tenga que configurarlo en "true".
OVERLEAF_HISTORY_S3_PATH_STYLE="true"

# región del bucket. Lo más probable es que no necesite 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 %}

Siga 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

# Ponga el contenido de las políticas de la sección anterior en los
# archivos JSON correspondientes policy-filestore.json y policy-history.json.

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

# buckets del almacén de archivos, usuario y política
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 del historial, usuario y política
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://overleaf-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.
