How to install Mercure v0.13.0 on Debian

This tutorial is an update on How to install mercure on debian for the newest version of Mercure at the moment of writing.

How to install Mercure

First you need to download the binary from the Mercure GitHub Releases. The release this tutorial is targeting is mercure_0.13.0_Linux_x86_64.tar.gz.

wget https://github.com/dunglas/mercure/releases/download/v0.13.0/mercure_0.13.0_Linux_x86_64.tar.gz && mkdir mercure && tar -zxvf mercure_0.13.0_Linux_x86_64.tar.gz -C mercure

Now you can run the mercure executable by running:

MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!' MERCURE_SUBSCRIBER_JWT_KEY='!ChangeMe!' SERVER_NAME=:3000 ./mercure run -config Caddyfile.dev

How to configure mercure as a service

For a detailed description on setting up supervisor check out the original tutorial about installing mercure on debian. Here I’ll just cover the new supervisor configuration.

#/etc/supervisor/conf.d/mercure.conf
[program:mercure]
command=/path/to/mercure
process_name=%(program_name)s_%(process_num)s
numprocs=1
environment=JWT_KEY="!ChangeMe!",SERVER_NAME=':3000', DEMO=1, ALLOW_ANONYMOUS=1, CORS_ALLOWED_ORIGINS=, PUBLISH_ALLOWED_ORIGINS='', USE_FORWARDED_HEADERS=1, DEBUG=1
directory=/tmp
autostart=true
autorestart=true
startsecs=5
startretries=10
user=www-data
redirect_stderr=false
stdout_capture_maxbytes=1MB
stderr_capture_maxbytes=1MB
stdout_logfile=/path/to/mercure/out.log
stderr_logfile=/path/to/mercure/error.log

For information about generating JWT Tokens and pushing updates refer to the original tutorial linked on top.

About Pavel Petrov 2 Articles |  21 How-tos
Pavel is a senior developer for the last 7 years, with extended interest in Linux administration, WordPress and Symfony.

Be the first to comment

Leave a Reply

Your email address will not be published.


*