remdoc
v0.1.3
Published
CLI tool for deploying and managing Docker containers via Portainer
Readme
remdoc
remdoc is a CLI tool for deploying and managing Docker containers on a remote server via the Portainer API.
Status
Still in development and early release. Some features and stuff still in planning.
Requirements
- Go 1.21+ (for building)
- Access to a Portainer instance and a Personal Access Token (JWT)
Install
Install with npm
npm i -g remdocInstall from source
git clone https://github.com/Elias-Larsson/remdoc.git
cd remdoc
go build -o remdoc ./cmd/remdocLogin (recommended)
Use the CLI to authenticate with your Portainer username and password. This will
store a JWT in ~/.remdoc/config.json with secure permissions:
remdoc login --username adminYou can also pass a password directly (not recommended on shared systems):
remdoc login -u admin -p yourpasswordConfigure (manual)
You can also create/edit the config file manually if you already have a JWT:
- Linux/macOS:
$HOME/.config/remdoc/config.json - Windows:
%APPDATA%\remdoc\config.json
Example config.json:
{
"portainer_url": "https://your-portainer.example.com",
"jwt": "<YOUR_PORTAINER_JWT>"
}Usage
Deploy a container:
remdoc deploy --image nginx:latest --name my-nginx --port 8080:80List containers:
remdoc statusStart/stop/remove containers:
remdoc start <container>
remdoc stop <container>
remdoc rm <container>Deploy a local compose file as a stack:
remdoc compose --file ./docker-compose.yml --name my-stackCommands
login– authenticate and store JWT (recommended)deploy– deploy a single containerstatus– list containersstart– start a containerstop– stop a containerrm– remove a containercompose– deploy a Docker Compose file as a stack
Notes
- Stack names are required by Portainer; if you omit
--name, the file name is used. - Compose deployments currently use the Portainer stack API with the compose file content.
