Ep.2 ติดตั้ง Docker และ n8n

3 min read 6 days ago
Published on Aug 31, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

In this tutorial, we will walk through the process of installing Docker and setting up n8n, an open-source workflow automation tool. This guide is perfect for developers looking to automate tasks and integrate various applications seamlessly.

Step 1: Install Docker

To begin, we need to install Docker, which will allow us to run n8n in a containerized environment.

  1. Download Docker

    • Visit the official Docker website at docker.com.
    • Choose the version suitable for your operating system (Windows, macOS, or Linux).
  2. Install Docker

    • Follow the installation instructions specific to your operating system.
    • For Windows and macOS, double-click the downloaded file and follow the prompts.
    • For Linux, use the terminal to run the installation commands provided in the Docker documentation.
  3. Verify Docker Installation

    • Open your terminal or command prompt.
    • Run the following command to check if Docker is installed correctly:
      docker --version
      
    • You should see the installed Docker version if everything is working properly.

Step 2: Install n8n

With Docker set up, we can now install n8n.

  1. Pull the n8n Docker Image

    • In your terminal, run the following command to download the n8n image:
      docker pull n8nio/n8n
      
  2. Run n8n in a Docker Container

    • Use the following command to start n8n:
      docker run -it --rm \
        -p 5678:5678 \
        -e N8N_BASIC_AUTH_ACTIVE=true \
        -e N8N_BASIC_AUTH_USER=your_username \
        -e N8N_BASIC_AUTH_PASSWORD=your_password \
        n8nio/n8n
      
    • Replace your_username and your_password with your desired credentials.
  3. Access n8n

    • Open a web browser and navigate to http://localhost:5678.
    • You will be prompted to log in using the credentials you set earlier.

Step 3: Download Sample Workflow

To get started with n8n, it can be helpful to have a sample workflow.

  1. Visit the Sample Workflow Link

  2. Download the Workflow

    • Follow the instructions on the page to download the sample workflow file.
  3. Import the Workflow into n8n

    • In the n8n interface, click on the "Import" option and upload the downloaded workflow file.

Conclusion

You have now successfully installed Docker and n8n, and imported a sample workflow to get you started. This setup will enable you to automate tasks and streamline your processes. For further exploration, consider creating your own workflows or integrating additional applications with n8n. Happy automating!