Skip to content

Installation

Requirements

  • AdonisJS 7 (Core is the only hard dependency)
  • Node.js 24+

Install

sh
node ace add @jrmc/adonis-attachment@next

The add command runs the configure hook, which:

  • creates config/attachment.ts (using local filesystem storage by default),
  • registers the attachment provider in adonisrc.ts,
  • registers the package's Ace commands (make:attachments-table, make:attachment-v5-migration, make:converter).

That's enough to start creating attachments. Everything below is optional.

Optional integrations

Install these only when you actually enable the matching feature.

PackageEnables
@adonisjs/driveStoring files on S3, GCS, or Drive's local disk - see Configuration.
@adonisjs/lucidDatabase-backed persistence, relations, and variants - see With Lucid.
@adonisjs/queueProcessing variant jobs with a real worker - see Background processing.
sh
node ace add @adonisjs/drive   # object storage
node ace add @adonisjs/lucid   # database persistence
node ace add @adonisjs/queue   # background workers

Run only the commands for integrations you need and complete their configuration prompts. Installing an integration with npm install alone does not register its provider.

Media features have separate optional dependencies:

sh
npm install sharp       # image conversion and technical metadata (including SVG)
npm install exifreader  # EXIF metadata when enabled
npm install blurhash    # blurhash when enabled (also requires sharp)

Video, PDF, and Office processing use system executables; see the requirements by source format and binary paths.

TIP

You don't need @adonisjs/queue just to generate variants - an in-memory queue ships with the package and runs jobs in the same process. Add the real queue when you outgrow it.

Next: Configuration.