# FreshRSS

[https://github.com/FreshRSS/FreshRSS/tree/edge/Docker](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker)

# Deploy FreshRSS with Docker

<div class="markdown-heading" dir="auto" id="bkmrk-">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#deploy-freshrss-with-docker)</div>FreshRSS is a self-hosted RSS feed aggregator.

- Official website: [`freshrss.org`](https://freshrss.org/)
- Official Docker images: [`hub.docker.com/r/freshrss/freshrss`](https://hub.docker.com/r/freshrss/freshrss/)
- Repository: [`github.com/FreshRSS/FreshRSS`](https://github.com/FreshRSS/FreshRSS/)
- Documentation: [`freshrss.github.io/FreshRSS`](https://freshrss.github.io/FreshRSS/)
- License: [GNU AGPL 3](https://www.gnu.org/licenses/agpl-3.0.html)

[![FreshRSS logo](https://github.com/FreshRSS/FreshRSS/raw/edge/docs/img/FreshRSS-logo.png)](https://github.com/FreshRSS/FreshRSS/raw/edge/docs/img/FreshRSS-logo.png)

## Install Docker

<div class="markdown-heading" dir="auto" id="bkmrk--3">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#install-docker)</div>See [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/)

Example for Linux Debian / Ubuntu:

```
# Install default Docker Compose and automatically the corresponding version of Docker
apt install docker-compose-v2
```

<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" id="bkmrk--5"><div class="zeroclipboard-container">  
</div></div>## Quick run

<div class="markdown-heading" dir="auto" id="bkmrk--6">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#quick-run)</div>Example running FreshRSS (or scroll down to the [Docker Compose](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#docker-compose) section instead):

```
docker run -d --restart unless-stopped --log-opt max-size=10m \
  -p 8080:80 \
  -e TZ=Europe/Paris \
  -e 'CRON_MIN=1,31' \
  -v freshrss_data:/var/www/FreshRSS/data \
  -v freshrss_extensions:/var/www/FreshRSS/extensions \
  --name freshrss \
  freshrss/freshrss
```

<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" id="bkmrk--8"><div class="zeroclipboard-container">  
</div></div>- Exposing on port 8080
- With a [server timezone](http://php.net/timezones) (default is `UTC`)
- With an automatic cron job to refresh feeds
- Saving FreshRSS data in a Docker volume `freshrss_data` and optional extensions in `freshrss_extensions`
- Using the default image, which is the latest stable release

### Complete installation

<div class="markdown-heading" dir="auto" id="bkmrk--9">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#complete-installation)</div>Browse to your server [https://freshrss.example.net/](https://freshrss.example.net/) to complete the installation via the FreshRSS Web interface, or use the command line described below.

## Command line

<div class="markdown-heading" dir="auto" id="bkmrk--11">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#command-line)</div>See the [CLI documentation](https://github.com/FreshRSS/FreshRSS/blob/edge/cli/README.md) for all the commands, which can be applied like:

```
docker exec --user www-data freshrss cli/list-users.php
```

<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" id="bkmrk--13"><div class="zeroclipboard-container">  
</div></div>Example of installation via command line:

```
docker exec --user www-data freshrss cli/do-install.php --default_user freshrss

docker exec --user www-data freshrss cli/create-user.php --user freshrss --password freshrss
```

<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" id="bkmrk--14"><div class="zeroclipboard-container">  
</div></div>> ℹ️ You have to replace `--user www-data` by `--user apache` when using our images based on Linux Alpine.

## Our Docker image variants

<div class="markdown-heading" dir="auto" id="bkmrk--15">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#our-docker-image-variants)</div>The [tags](https://hub.docker.com/r/freshrss/freshrss/tags) correspond to FreshRSS branches and versions:

- `:latest` (default) is the [latest stable release](https://github.com/FreshRSS/FreshRSS/releases/latest)
- `:edge` is the rolling release, same than our [git `edge` branch](https://github.com/FreshRSS/FreshRSS/tree/edge)
- `:x.y.z` tags correspond to [specific FreshRSS releases](https://github.com/FreshRSS/FreshRSS/releases), allowing you to target a precise version for deployment
- `:x` tags track the latest release within a major version series. For instance, `:1` will update to include any `1.x` releases, but will exclude versions beyond `2.x`
- `*-alpine` use Linux Alpine as base-image instead of Debian
- Our Docker images are designed with multi-architecture support, accommodating a variety of Linux platforms including `linux/arm/v7`, `linux/arm64`, and `linux/amd64`. 
    - For other platforms, see the [custom build section](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#build-custom-docker-image)

### Linux: Debian vs. Alpine

<div class="markdown-heading" dir="auto" id="bkmrk--17">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#linux-debian-vs-alpine)</div>Our default image is based on [Debian](https://www.debian.org/). We offer an alternative based on [Alpine](https://alpinelinux.org/) (with the `*-alpine` tag suffix). In [our tests](https://github.com/FreshRSS/FreshRSS/pull/2205) (2019), Alpine was slower, while Alpine is smaller on disk (and much faster to build), and with newer packages in general (Apache, PHP).

> ℹ️ For some rare systems, one variant might work but not the other, for instance due to kernel incompatibilities.

## Environment variables

<div class="markdown-heading" dir="auto" id="bkmrk--19">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#environment-variables)</div>- `TZ`: (default is `UTC`) A [server timezone](http://php.net/timezones)
- `CRON_MIN`: (default is disabled) Define minutes for the built-in cron job to automatically refresh feeds (see below for more advanced options)
- `DATA_PATH`: (default is empty, defined by `./constants.local.php` or `./constants.php`) Defines the path for writeable data.
- `FRESHRSS_ENV`: (default is `production`) Enables additional development information if set to `development` (increases the level of logging and ensures that errors are displayed) (see below for more development options)
- `COPY_LOG_TO_SYSLOG`: (default is `On`) Copy all the logs to syslog
- `COPY_SYSLOG_TO_STDERR`: (default is `On`) Copy syslog to Standard Error so that it is visible in docker logs
- `LISTEN`: (default is `80`) Modifies the internal Apache listening address and port, e.g. `0.0.0.0:8080` (for advanced users; useful for [Docker host networking](https://docs.docker.com/network/host/))
- `FRESHRSS_INSTALL`: automatically pass arguments to command line `cli/do-install.php` (for advanced users; see example in Docker Compose section). Only executed at the very first run (so far), so if you make any change, you need to delete your `freshrss` service, `freshrss_data` volume, before running again.
- `FRESHRSS_USER`: automatically pass arguments to command line `cli/create-user.php` (for advanced users; see example in Docker Compose section). Only executed at the very first run (so far), so if you make any change, you need to delete your `freshrss` service, `freshrss_data` volume, before running again.

## How to update

<div class="markdown-heading" dir="auto" id="bkmrk--21">[<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"></svg>](https://github.com/FreshRSS/FreshRSS/tree/edge/Docker#how-to-update)</div>```
# Rebuild an image (see build section below) or get a new online version:
docker pull freshrss/freshrss
# And then
docker stop freshrss
docker rename freshrss freshrss_old
# See the run section above for the full command
docker run ... --name freshrss freshrss/freshrss
# If everything is working, delete the old container
docker rm freshrss_old
```