elasticsearch-admin

Web administration for Elasticsearch (2.x to 8.x): cluster, nodes, indices, shards, index templates, repositories, snapshots ...

View on GitHub

Web administration for Elasticsearch (2.x to 8.x)

Table of contents

Disclaimer

(Back to table of contents)

The application named elasticsearch-admin is NOT affiliated in any way with Elasticsearch BV.

Elasticsearch is a trademark of Elasticsearch BV, registered in the U.S. and in other countries.

Features

(Back to table of contents)

Screenshots

(Back to table of contents)

Selection

(Back to screenshots)

elasticsearch-admin - Cluster summary

elasticsearch-admin - Cluster audit

elasticsearch-admin - Cluster allocation explain

elasticsearch-admin - Nodes list

elasticsearch-admin - Indices list

elasticsearch-admin - Shards list

elasticsearch-admin - Composable index templates

elasticsearch-admin - Snapshots list

All screenshots

(Back to screenshots)

Installation

(Back to table of contents)

Running with Docker

(Back to installation)

Requirements

(Back to running with Docker)

Steps

(Back to running with Docker)

The Docker image is hosted on Docker Hub Visit

docker pull stephanediondev/elasticsearch-admin

docker run -e "ELASTICSEARCH_URL=http://x.x.x.x:9200" -e "SECRET_REGISTER=xxxxx" -p 80:8080 -p 443:4443 -d --name elasticsearch-admin stephanediondev/elasticsearch-admin

Edit ELASTICSEARCH_URL and SECRET_REGISTER (random string to secure registration)

If Elasticsearch security features are enabled, add -e "ELASTICSEARCH_USERNAME=xxxxx" -e "ELASTICSEARCH_PASSWORD=xxxxx" or -e "ELASTICSEARCH_API_KEY=xxxxx"

If you have SSL certificates, add -v /path/privkey.pem:/etc/nginx/privkey.pem -v /path/fullchain.pem:/etc/nginx/fullchain.pem

Source installation

(Back to installation)

Requirements

(Back to source installation)

Web server

(Back to source installation)

Configure a vhost with the document root set to the public folder (ie /var/www/elasticsearch-admin/public)

Apache

(Back to web server)

Add the vhost below

<VirtualHost *:80>
    DocumentRoot "/var/www/elasticsearch-admin/public"
    ServerName your-domain-or-sub-domain
    ErrorLog ${APACHE_LOG_DIR}/elasticsearch-admin-error.log
    CustomLog ${APACHE_LOG_DIR}/elasticsearch-admin-access.log combined

    <Directory /var/www/elasticsearch-admin/public>
        AllowOverride None

        DirectoryIndex index.php

        <IfModule mod_negotiation.c>
            Options -MultiViews
        </IfModule>

        <IfModule mod_rewrite.c>
            RewriteEngine On

            RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
            RewriteRule .* - [E=BASE:%1]

            RewriteCond %{HTTP:Authorization} .+
            RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]

            RewriteCond %{ENV:REDIRECT_STATUS} =""
            RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^ %{ENV:BASE}/index.php [L]
        </IfModule>

        <IfModule !mod_rewrite.c>
            <IfModule mod_alias.c>
                RedirectMatch 307 ^/$ /index.php/
            </IfModule>
        </IfModule>
    </Directory>
</VirtualHost>

If you can’t edit a vhost, add the Apache pack to get the .htaccess file in the public folder

composer require symfony/apache-pack

nginx

Add the server definition below

(Back to web server)

server {
    listen [::]:8080 default_server;
    listen 8080 default_server;
    server_name your-domain-or-sub-domain;

    sendfile off;

    root /var/www/elasticsearch-admin/public;
    index index.php index.html;

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ ^/index\.php(/|$) {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;

        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        internal;
    }

    location ~ \.php$ {
        return 404;
    }
}

Steps

(Back to source installation)

Download or clone the repository from GitHub Visit

Launch the following commands to install

cd /var/www/elasticsearch-admin/

composer install

bin/console asset-map:compile

cp .env.dist .env

In the .env file edit ELASTICSEARCH_URL and SECRET_REGISTER (random string to secure registration)

If Elasticsearch security features are enabled, edit ELASTICSEARCH_USERNAME and ELASTICSEARCH_PASSWORD or ELASTICSEARCH_API_KEY

You can also edit VAPID_PUBLIC_KEY and VAPID_PRIVATE_KEY to use push notifications (only in HTTPS)

You can generate values with the command below

bin/console app:generate-vapid

Add a cron command to send notifications every 5 minutes

crontab -e
# m h dom mon dow command
*/5 * * * * cd /var/www/elasticsearch-admin && bin/console app:send-notifications

Launch

(Back to installation)

Once the installation is finished, you can access the application with one of the URL below (depending on your installation):

You will see a register page to create the first user (you need the secret registration key) View

After registration you can login View

License

(Back to table of contents)

MIT License

Privacy

(Back to table of contents)

This application does NOT collect and send any user data.

Tests

(Back to table of contents)

vendor/bin/phpstan analyse -l 6 src
vendor/bin/phpstan analyse -l 6 tests
bin/console app:phpunit
bin/phpunit