Skip to main content

Automate PostgreSQL & MySQL database management on Linux servers

Workflow preview

Workflow preview
100%
Automate PostgreSQL & MySQL database management on Linux servers preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This automated n8n workflow efficiently manages the setup, creation, and deletion of PostgreSQL and MySQL databases on a Linux server, executing tasks in approximately 10 seconds. It automates inst...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.ssh, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Oneclick AI Squad.

Original n8n.io source

1.1 Workflow description

Title
Automate PostgreSQL & MySQL database management on Linux servers
Workflow name
Automate PostgreSQL & MySQL database management on Linux servers

This automated n8n workflow efficiently manages the setup, creation, and deletion of PostgreSQL and MySQL databases on a Linux server, executing tasks in approximately 10 seconds. It automates installation, configuration, and user management with support for remote access.

Core Elements

  • Set Parameters - Defines server details, database type, action, and credentials
  • Type Check - Confirms the selected database type
  • PostgreSQL Action Check - Identifies the action for PostgreSQL
  • PostgreSQL Create Check - Validates creation conditions for PostgreSQL
  • Install PostgreSQL - Sets up and configures PostgreSQL
  • Create PostgreSQL DB - Establishes a new PostgreSQL database with user access
  • Delete PostgreSQL DB - Removes a PostgreSQL database and user
  • MySQL Action Check - Identifies the action for MySQL
  • MySQL Create Check - Validates creation conditions for MySQL
  • Install MySQL - Sets up and configures MySQL
  • Create MySQL DB - Establishes a new MySQL database with user access
  • Delete MySQL DB - Removes a MySQL database and user
  • Format Output - Structures the final workflow output

Getting Started Guide

  • Import the workflow into n8n
  • Adjust parameters in the Set Parameters node
  • Execute the workflow
  • Confirm the database operation on the server

Necessary Requirements

  • SSH-enabled Linux server
  • Root-level access rights

Customization Options

  • Switch db_type between PostgreSQL and MySQL
  • Select action (install, create, delete) via the action parameter
  • Tailor database_name, db_user, and db_password as needed

Features

  • Install Database Server - Deploys PostgreSQL or MySQL with optimal configuration
  • Create Database - Generates new databases with assigned users and permissions
  • Delete Database - Eliminates databases and their associated users

Parameters to Configure

  • server_host: Your Linux server IP address
  • server_user: SSH username (typically 'root')
  • server_password: SSH password
  • db_type: Select 'postgresql' or 'mysql'
  • action: Select 'install', 'create', or 'delete'
  • database_name: Name of the database to create or delete
  • db_user: Database username
  • db_password: Database password

How to Use

  • Copy the JSON code from the artifact
  • Access your n8n workspace
  • Choose "Import from JSON" or "+" → "From JSON"
  • Insert the JSON code
  • Set parameters in the "Set Parameters" node with your server information
  • Run the workflow

Workflow Actions

  • Install: Sets up the database server, enables remote access, and initializes the database
  • Create: Establishes a new database with a specific user
  • Delete: Erases the database and its associated user

The workflow automatically manages

  • Ubuntu/Debian package setup
  • Service initialization and configuration
  • Remote access setup
  • User and permission assignments
  • Authentication configuration

Update the parameters in the "Set Parameters" node with your server specifics and execute the workflow!

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Start

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Set Parameters

Type / Role
n8n-nodes-base.set - set
Config choices
Version 1

Block 3 - Database Type Check

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 4 - PostgreSQL Action Check

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 5 - MySQL Action Check

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 6 - Install PostgreSQL

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 7 - Install MySQL

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 8 - PostgreSQL Create Check

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 9 - MySQL Create Check

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 10 - Create PostgreSQL DB

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 11 - Create MySQL DB

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 12 - Delete PostgreSQL DB

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 13 - Delete MySQL DB

Type / Role
n8n-nodes-base.ssh - ssh
Config choices
Version 1

Block 14 - Format Output

Type / Role
n8n-nodes-base.set - set
Config choices
Version 1

Block 15 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automate PostgreSQL & MySQL database management on Linux servers
Complexity advanced
Nodes 15
Categories DevOps
Author Oneclick AI Squad
Published 18 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6134/6134.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate PostgreSQL & MySQL database management on Linux servers do?

This automated n8n workflow efficiently manages the setup, creation, and deletion of PostgreSQL and MySQL databases on a Linux server, executing tasks in approximately 10 seconds. It automates inst...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.