"use client"; import { useRef, useState } from "react"; import { copySetupTokenCommand, SETUP_TOKEN_COMMAND } from "./setup-token-help"; import styles from "./setup.module.css"; export default function SetupTokenHelp({ disabled = false }: { disabled?: boolean }) { const dialog = useRef(null); const trigger = useRef(null); const commandField = useRef(null); const [copyStatus, setCopyStatus] = useState(""); const copyCommand = async () => { const result = await copySetupTokenCommand(navigator.clipboard, commandField.current); setCopyStatus( result === "copied" ? "Command copied. Paste it into the Magent container console." : result === "selected" ? "Automatic copying is unavailable. The command is selected; press Ctrl+C (Command+C on Mac), or touch and hold to copy." : "Automatic copying is unavailable. Select and copy the command above.", ); }; return (
trigger.current?.focus()} >

Get your setup token

Magent generates a private setup token when a managed installation starts. Retrieve it from your server console to create the first administrator.

  1. In Portainer, open Containers and select the healthy Magent container.
  2. Open Console, choose command /bin/ash and user magent, then connect.
  3. Run the command below, then copy its output into the Setup token field on this page.