Skip to content

Commit

Permalink
Split installation docs into multiple pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Sep 19, 2023
1 parent 3932b6e commit c246f35
Show file tree
Hide file tree
Showing 10 changed files with 399 additions and 340 deletions.
7 changes: 7 additions & 0 deletions content/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ aliases:
- [Configuration Parameters]({{< relref configuration >}})
- [Command Line Usage]({{< relref cli >}})
- [Installation Instructions]({{< relref installation >}})
- [Packages]({{< ref "installation" >}}#packages)
- [Database Configuration]({{< ref "database.md" >}})
- [Manual Installation]({{< ref "binary.md" >}})
- [Debian/Ubuntu/Raspbian Package Installation]({{< ref "debian.md" >}})
- [RPM Package Installation]({{< ref "rhel.md" >}})
- [Alpine Linux Installation]({{< ref "alpine.md" >}})
- [Docker Installation]({{< ref "docker.md" >}})
- [Upgrading the Application]({{< relref upgrade >}})
- [How-To's]({{< relref howto >}})
- [Migration from Older Versions]({{< relref migration >}})
Expand Down
56 changes: 56 additions & 0 deletions content/docs/alpine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Alpine Linux Installation
description: Instructions to install Miniflux on Alpine Linux
url: docs/alpine.html
---

[Alpine Linux](https://alpinelinux.org/) is a lightweight Linux distribution that is perfectly suited for running Miniflux.

An APK package is available from the community repository (it was in testing before).

Edit the file `/etc/apk/repositories` to enable the Edge repository: `http://dl-cdn.alpinelinux.org/alpine/edge/community`. And then run `apk update`.

The Miniflux installation is simple as running:

```bash
apk add miniflux miniflux-openrc miniflux-doc
```

Do not forget to install Postgresql:

```
apk add postgresql postgresql-contrib
```

Configure the database and enable the `HSTORE` extension as [mentioned previously]({{< ref "database.md" >}}).

On Alpine Linux, the Miniflux process is supervised by `supervise-daemon` from [OpenRC](https://github.com/OpenRC/openrc) (there is no Systemd).
The log file `/var/log/miniflux.log` is rotated with `logrotate`.

In this context, the configuration file `/etc/miniflux.conf` is used instead of environment variables:

```
# /etc/miniflux.conf
LOG_DATE_TIME=yes
LISTEN_ADDR=127.0.0.1:8080
DATABASE_URL=user=postgres password=secret dbname=miniflux sslmode=disable
# Run SQL migrations automatically:
# RUN_MIGRATIONS=1
```

To finalize the installation, create the database schema and a first user:

```bash
miniflux -c /etc/miniflux.conf -migrate
miniflux -c /etc/miniflux.conf -create-admin
```

And finally, start the application:

```bash
service miniflux start
```

Make sure to take a look a the list of [configuration parameters]({{< relref configuration >}}) to customize your installation.
24 changes: 24 additions & 0 deletions content/docs/binary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Manual Binary Installation
description: Instructions to install Miniflux binary manually
url: docs/binary_installation.html
---

This document describes how to install the Miniflux binary on your Linux server.

Make sure to [install and configure Postgresql]({{< ref "database.md" >}}) before installing Miniflux.

You can download precompiled binaries from the [GitHub Releases page](https://github.com/miniflux/v2/releases). You could also [build the application from the source code]({{< ref "development.md" >}}).

1. Copy the precompiled binary somewhere on your server, for example in `/usr/local/bin`
2. Make the file executable: `chmod +x miniflux`
3. Define the environment variable `DATABASE_URL` if necessary
4. Run the SQL migrations: `miniflux -migrate`
5. Create an admin user: `miniflux -create-admin`
6. Start the application: `miniflux`

<p class="info">
It's recommended to configure a process manager like systemd or supervisord to supervise the Miniflux daemon.
</p>

Make sure to take a look a the list of [configuration parameters]({{< relref configuration >}}) to customize your installation.
15 changes: 0 additions & 15 deletions content/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ The configuration file is loaded first if specified. Environment variables takes

- [Configuration Options](#options)
- [Configuration File](#config-file)
- [Database Connection Parameters](#dsn)

<h2 id="options">Configuration Options <a class="anchor" href="#options" title="Permalink">¶</a></h2>

Expand Down Expand Up @@ -415,17 +414,3 @@ You can also dump interpreted values with the flag `-config-dump` for debugging.
<p class="info">
Systemd uses the file <code>/etc/miniflux.conf</code> to populate environment variables.
</p>

<h2 id="dsn">Database Connection Parameters <a class="anchor" href="#dsn" title="Permalink">¶</a></h2>

Miniflux uses the Golang library [pq](https://github.com/lib/pq) to communicate with PostgreSQL.
The list of connection parameters are available on [this page](https://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters).

The default value for `DATABASE_URL` is `user=postgres password=postgres dbname=miniflux2 sslmode=disable`.

You could also use the URL format `postgres://postgres:postgres@localhost/miniflux2?sslmode=disable`.

<div class="warning">
Password that contains special characters like ^ might be rejected since Miniflux 2.0.3. <a href="https://go-review.googlesource.com/c/go/+/87038">Golang v1.10 is now validating the password</a> and will return this error: <code>net/url: invalid userinfo</code>.
To avoid this issue, do not use the URL format for <code>DATABASE_URL</code> or make sure the password is URL encoded.
</div>
80 changes: 80 additions & 0 deletions content/docs/database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: Database Configuration
description: Instructions to configure Postgresql for Miniflux
url: docs/database.html
---

- [Postgresql Installation](#installation)
- [Postgresql Configuration](#configuration)
- [Database Connection Parameters](#dsn)

This document describes how to configure PostgreSQL for Miniflux.

<h2 id="installation">Database Installation <a class="anchor" href="#installation" title="Permalink">¶</a></h2>

The first step is to install PostgreSQL with your package manager.

For example, on Debian it's simple as typing this command:

```bash
sudo apt install postgresql postgresql-contrib
```

<h2 id="configuration">Database Configuration <a class="anchor" href="#configuration" title="Permalink">¶</a></h2>

Here an example from the command line:

```
# Switch to the postgres user
$ su - postgres
# Create a database user for Miniflux
$ createuser -P miniflux
Enter password for new role: ******
Enter it again: ******
# Create a database for miniflux that belongs to our user
$ createdb -O miniflux miniflux
# Create the extension hstore as superuser
$ psql miniflux -c 'create extension hstore'
CREATE EXTENSION
```

### Enabling HSTORE extension for Postgresql

Creating Postgresql extensions requires the `SUPERUSER` privilege.
Several solutions are available:

1) Give `SUPERUSER` privileges to the miniflux user only during the schema migration:

```sql
ALTER USER miniflux WITH SUPERUSER;
-- Run the migrations (miniflux -migrate)
ALTER USER miniflux WITH NOSUPERUSER;
```

2) You could [create the hstore extension](https://www.postgresql.org/docs/current/static/sql-createextension.html) with another user that have the ``SUPERUSER`` privileges before running the migrations.

```
sudo -u postgres psql $MINIFLUX_DATABASE
> CREATE EXTENSION hstore;
```

Note that if you use Debian or Ubuntu, you might have to install the `postgresql-contrib` package to activate the `HSTORE` extension.

Recent versions of Miniflux non longer uses the `HSTORE` extension but it still required to run the SQL migrations.

<h2 id="dsn">Database Connection Parameters <a class="anchor" href="#dsn" title="Permalink">¶</a></h2>

Miniflux uses the Golang library [pq](https://github.com/lib/pq) to communicate with PostgreSQL.
The list of connection parameters are available on [this page](https://pkg.go.dev/github.com/lib/pq?utm_source=godoc#hdr-Connection_String_Parameters).

The default value for `DATABASE_URL` is `user=postgres password=postgres dbname=miniflux2 sslmode=disable`.

You could also use the URL format `postgres://postgres:postgres@localhost/miniflux2?sslmode=disable`.

<div class="warning">
Password that contains special characters like ^ might be rejected since Miniflux 2.0.3. <a href="https://go-review.googlesource.com/c/go/+/87038">Golang v1.10 is now validating the password</a> and will return this error: <code>net/url: invalid userinfo</code>.
To avoid this issue, do not use the URL format for <code>DATABASE_URL</code>, or make sure the password is URL encoded.
</div>
57 changes: 57 additions & 0 deletions content/docs/debian.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: Debian Installation
description: Instructions to install Miniflux on Debian GNU/Linux
url: docs/debian.html
---

- [Install the Debian Package Manually](#debian-package)
- [Install the Debian Package from the APT Repo](#apt-repo)
- [Configure Miniflux](#configuration)

You must have Debian >= 8 or Ubuntu >= 16.04.

When using the Debian package, the Miniflux daemon is supervised by systemd.

Make sure to [install and configure Postgresql]({{< ref "database.md" >}}) before installing Miniflux.

<h2 id="debian-package">Install Miniflux with the Debian package <a class="anchor" href="#debian-package" title="Permalink">¶</a></h2>

1. Download the Debian package from the [GitHub Releases page](https://github.com/miniflux/v2/releases).
2. Install the Debian package: `dpkg -i miniflux_2.0.13_amd64.deb`

<h2 id="apt-repo">Install Miniflux from the APT Repository <a class="anchor" href="#apt-repo" title="Permalink">¶</a></h2>

```bash
echo "deb [trusted=yes] https://repo.miniflux.app/apt/ /" | sudo tee /etc/apt/sources.list.d/miniflux.list > /dev/null
apt update
```

Then install the package:

```bash
apt install miniflux
```

To upgrade Miniflux, run `apt upgrade miniflux`, and don't forget to run the database migrations.

<div class="warning">
The previous repository URL <code>https://apt.miniflux.app/</code> is deprecated in favor of <code>https://repo.miniflux.app/apt/</code>.
</div>

<h2 id="configuration">Configure Miniflux <a class="anchor" href="#configuration" title="Permalink">¶</a></h2>

1. Define the environment variable `DATABASE_URL` in `/etc/miniflux.conf`
2. Run the SQL migrations manually: `miniflux -migrate`, or set the variable `RUN_MIGRATIONS=1` in `/etc/miniflux.conf`
3. Create an admin user: `miniflux -create-admin`
4. Restart the process: `systemctl restart miniflux`
5. Check the process status: `systemctl status miniflux`

Since Miniflux v2.0.25, the Debian package is available for multiple architectures: `amd64`, `arm64`, and `armhf`.
This way, it's very easy to install Miniflux on a Raspberry Pi.

<p class="info">
Systemd reads the environment variables from the file <code>/etc/miniflux.conf</code>.
You must restart the service to take the new values into consideration.
</p>

Make sure to take a look a the list of [configuration parameters]({{< relref configuration >}}) to customize your installation.
107 changes: 107 additions & 0 deletions content/docs/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
title: Miniflux Installation with Docker
description: Instructions to install Miniflux with Docker
url: docs/dacker.html
---

This document describes how to use the Docker images of Miniflux.

- [Container Registries](#registries)
- [How to Run the Container Manually](#docker)
- [Docker Compose](#docker-compose)

<h2 id="registries">Container Registries <a class="anchor" href="#registries" title="Permalink">¶</a></h2>

**Docker Registries:**

Docker images are published to 3 different container registries:

- [Docker Hub Registry](https://hub.docker.com/r/miniflux/miniflux): `docker.io/miniflux/miniflux`
- [GitHub Container Registry](https://github.com/miniflux/v2/pkgs/container/miniflux): `ghcr.io/miniflux/miniflux`
- [Quay.io RedHat Container Registry](https://quay.io/repository/miniflux/miniflux): `quay.io/miniflux/miniflux`

**Docker Architectures:**

- `amd64`
- `arm64`
- `arm/v7`
- `arm/v6`

**Docker Tags Naming Convention:**

- `latest`: Latest stable version
- `2.0.25`: Specific version
- `nightly`: Development version

The recommendation is to use a pinned version to avoid unexpected updates.

<h2 id="docker">How to Run the Container Manually <a class="anchor" href="#docker" title="Permalink">¶</a></h2>

Pull the image and run the container:

```bash
docker run -d \
-p 80:8080 \
--name miniflux \
-e "DATABASE_URL=postgres://miniflux:*password*@*dbhost*/miniflux?sslmode=disable" \
-e "RUN_MIGRATIONS=1" \
-e "CREATE_ADMIN=1" \
-e "ADMIN_USERNAME=*username*" \
-e "ADMIN_PASSWORD=*password*" \
docker.io/miniflux/miniflux:latest
```

Running the command above will run the migrations and sets up a new admin account with the chosen username and password.

Once the container is started, you should be able to access the application on the exposed port which is port 80 in this example.

<h2 id="docker-compose">Docker Compose <a class="anchor" href="#docker-compose" title="Permalink">¶</a></h2>

Here is an example of a Docker Compose file:

```yaml
services:
miniflux:
image: miniflux/miniflux:latest
ports:
- "80:8080"
depends_on:
db:
condition: service_healthy
environment:
- DATABASE_URL=postgres://miniflux:secret@db/miniflux?sslmode=disable
- RUN_MIGRATIONS=1
- CREATE_ADMIN=1
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=test123
db:
image: postgres:15
environment:
- POSTGRES_USER=miniflux
- POSTGRES_PASSWORD=secret
volumes:
- miniflux-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "miniflux"]
interval: 10s
start_period: 30s
volumes:
miniflux-db:
```
- `DATABASE_URL` is used to define the database connection parameters
- `RUN_MIGRATIONS=1` runs the SQL migrations automatically
- `CREATE_ADMIN`, `ADMIN_USERNAME`, `ADMIN_PASSWORD` allows us to create the first admin user, and it can be removed after the first initialization.

There are more examples in the Git repository with Traefik and Caddy: https://github.com/miniflux/v2/tree/master/contrib/docker-compose

You could also configure an optional health check in your Docker Compose file:

```yaml
miniflux:
image: miniflux/miniflux:latest
healthcheck:
test: ["CMD", "/usr/bin/miniflux", "-healthcheck", "auto"]
```

Make sure to take a look a the list of [configuration parameters]({{< relref configuration >}}) to customize your installation.
Loading

0 comments on commit c246f35

Please sign in to comment.