Ep.2 ติดตั้ง Docker และ n8n
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.
-
Download Docker
- Visit the official Docker website at docker.com.
- Choose the version suitable for your operating system (Windows, macOS, or Linux).
-
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.
-
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.
-
Pull the n8n Docker Image
- In your terminal, run the following command to download the n8n image:
docker pull n8nio/n8n
- In your terminal, run the following command to download the n8n image:
-
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
andyour_password
with your desired credentials.
- Use the following command to start n8n:
-
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.
- Open a web browser and navigate to
Step 3: Download Sample Workflow
To get started with n8n, it can be helpful to have a sample workflow.
-
Visit the Sample Workflow Link
- Go to the provided link: Sample Workflow.
-
Download the Workflow
- Follow the instructions on the page to download the sample workflow file.
-
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!