Arkime 7 Upload Only Viewer
This is a complete Docker Compose file for looking at pcap files with the Arkime 7 development snapshot.
There is no live capture. You upload pcap on the viewer’s Upload page and the viewer runs capture on each file with the JA4+ plugin loaded.
It starts its own single node OpenSearch, so Docker is all you need.
Arkime 7 is still a release candidate and this uses the snapshot image, so don’t use it for anything you need to keep.
See Arkime with Docker for the image tags, the docker.sh options and examples with live capture.
The Compose File
Hover over the file and use the copy button in its top right corner, then save it as docker-compose.yml in an empty directory.
The instructions are in the comments at the top of the file.
Everything you may want to change is in the SETTINGS block near the top of the file. Only two things are required: the password secret before the first start, and the admin password after the first login.
################################################################################
# Arkime 7 (dev7 snapshot) upload only viewer with the JA4+ plugin
#
# No live capture. You upload pcap in the viewer and it runs capture on each file.
#
# BEFORE YOU START
# Edit the SETTINGS block just below these instructions. Each one is marked
# CHANGE (required) - replace before the first start
# CHANGE (optional) - the default works, change it if it doesn't suit you
# Everything after that block can be left alone.
# OpenSearch is given 4GB of memory by default, so the machine (or Docker
# Desktop) needs about 6GB free.
#
# START
# 1. Save this file as docker-compose.yml in an empty directory
# 2. docker compose up -d
# 3. docker compose logs -f viewer
# Wait for "listening on host :: port 8005", about a minute the first time
# 4. Browse to http://localhost:8005 and log in with admin / admin
# 5. CHANGE (required): change the admin password, Settings -> Password
#
# UPLOAD PCAP
# 1. Click Upload in the top navigation bar
# 2. Choose a pcap file, optionally add comma separated tags, click Upload
# 3. Go to Sessions and set the time range to All, sessions keep the
# timestamps from the pcap
# JA4 values: search for tls.ja4 == EXISTS! or open the JA4+ dashboard
# After the very first upload the viewer needs up to 2 minutes to learn the
# JA4 fields, until then that search says "Unknown field tls.ja4"
#
# UPDATE TO THE NEWEST SNAPSHOT (the database upgrades itself)
# docker compose pull
# docker compose up -d
#
# STOP
# docker compose down keeps the data
# docker compose down -v DELETES all sessions, pcap and users
#
# THESE LOG LINES ARE EXPECTED
# WARNING - /opt/arkime/etc/config.ini doesn't exist
# Error loading configuration: the `AccountID` option is required
#
# IF AN UPLOAD FAILS
# Add --debug after "-n upload" in the viewer command, docker compose up -d,
# upload again, then read: docker compose logs viewer
################################################################################
name: arkime-upload
################################################################################
# SETTINGS
#
# Further down, a value like *pcap-mount means "use the setting named
# pcap-mount from this block".
################################################################################
# CHANGE (required): replace with your own long random string, keep the quotes
# and don't use a $ in it. It encrypts the stored user passwords, so changing
# it later breaks every login.
x-password-secret: &password-secret "CHANGE-ME-to-a-long-random-string"
# CHANGE (optional): where the viewer listens. As is, only this machine can
# connect. Use "8005:8005" to let other machines in, AFTER changing the admin
# password. The first number is the port on the host.
x-viewer-port: &viewer-port "127.0.0.1:8005:8005"
# CHANGE (optional): OpenSearch memory. It is not sized automatically, keep
# both numbers the same and at most half the machine's memory.
x-opensearch-memory: &opensearch-memory "-Xms4g -Xmx4g"
# CHANGE (optional): where the uploaded pcap and the database are kept.
# "pcap" and "osdata" are Docker named volumes, Docker creates them and keeps
# them in its own data directory. To use a disk you choose, replace the name
# before the colon with a directory that exists, for example
# x-pcap-mount: &pcap-mount /data/arkime/pcap:/opt/arkime/raw
# For the database directory also run "chown 1000 /your/dir" first.
x-pcap-mount: &pcap-mount pcap:/opt/arkime/raw
x-osdata-mount: &osdata-mount osdata:/usr/share/opensearch/data
# CHANGE (optional): the Arkime image. This one follows the tip of dev7.
x-arkime-image: &arkime-image ghcr.io/arkime/arkime/arkime:snapshot-v7-ja4-latest
################################################################################
# END OF SETTINGS
################################################################################
services:
# There is no "ports:" here on purpose. OpenSearch has no password in this
# setup, so it is only reachable by the other containers, never from the
# host or the network. Only the viewer is published.
opensearch:
image: opensearchproject/opensearch:3.9.0
environment:
discovery.type: single-node
DISABLE_SECURITY_PLUGIN: "true"
DISABLE_INSTALL_DEMO_CONFIG: "true"
OPENSEARCH_JAVA_OPTS: *opensearch-memory
ulimits:
nofile:
soft: 65536
hard: 65536
volumes:
- *osdata-mount
healthcheck:
test: ["CMD-SHELL", "curl -sf 'http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=5s' || exit 1"]
interval: 10s
timeout: 10s
retries: 30
restart: unless-stopped
# Runs on every "docker compose up" and then exits: makes the pcap volume
# writable by nobody, then creates or upgrades the Arkime indices.
init:
image: *arkime-image
user: root
command: >
bash -c "mkdir -p /opt/arkime/raw && chown nobody /opt/arkime/raw &&
exec /opt/arkime/bin/docker.sh db.pl --wait-for-db http://opensearch:9200
-- http://opensearch:9200 initorupgradenoprompt --ifneeded"
depends_on:
opensearch:
condition: service_healthy
volumes:
- *pcap-mount
restart: "no"
viewer:
image: *arkime-image
# Fixed hostname and node name, so older uploads still find their pcap
# after the container is recreated. Don't change these once you have data.
hostname: upload
user: root
command: >
/opt/arkime/bin/docker.sh viewer --wait-for-db http://opensearch:9200
--add-admin --update-geo -- -n upload
depends_on:
init:
condition: service_completed_successfully
ports:
- *viewer-port
environment:
ARKIME__elasticsearch: http://opensearch:9200
ARKIME__viewPort: "8005"
ARKIME__authMode: digest
ARKIME__cronQueries: auto
ARKIME__dropUser: nobody
ARKIME__passwordSecret: *password-secret
# ---- pcap upload ----
# The viewer runs this for each uploaded file.
ARKIME__uploadCommand: /opt/arkime/bin/capture --copy -n {NODE} -r {TMPFILE} {TAGS}
# Rarely needed: the largest upload in bytes, the default is 2GB
#ARKIME__uploadFileSizeLimit: "2147483648"
# Rarely needed: who can upload, the default is every Arkime user
#ARKIME__uploadRoles: arkimeAdmin
# ---- settings for the capture that the upload runs ----
# The image only has the JA4+ plugin for its own architecture, the other
# name is skipped.
ARKIME__plugins: ja4plus.amd64.so;ja4plus.arm64.so
ARKIME__rirFile: /opt/arkime/etc/ipv4-address-space.csv
ARKIME__ouiFile: /opt/arkime/etc/oui.txt
volumes:
- etc:/opt/arkime/etc
- *pcap-mount
restart: unless-stopped
# Required, this declares the named volumes used above. Leave as is, even if
# you changed the mounts in SETTINGS, an unused one is harmless.
volumes:
osdata:
etc:
pcap:
How It Works
- uploadCommand turns on the viewer’s Upload page and is what the viewer runs for each uploaded file.
- That
captureis started by the viewer, so it reads the viewer’sARKIME__environment variables. That is why the capture settings (plugins,rirFile,ouiFile) are on the viewer service. - The viewer drops to
nobodybefore it runscapture, and--copywrites the packets into the pcap volume, so theinitservice makes that volume writable bynobody. - The viewer has a fixed node name,
-n upload. Without it the node name is the container id, which changes when the container is recreated, and older sessions could no longer find their pcap. - OpenSearch runs with its security plugin off and has no
ports:entry, so only the other containers can reach it. The viewer is the only thing published on the host. - There is no
config.ini, everything is set with environment variables. To use one instead, mount it at/opt/arkime/etc/config.ini.