Configuration in Digital Ocean's Droplet Console

Good day,

I have a n8n installation in Digital Ocean which is working great. The problem is that I lost the admin password and I wanted to configure SMTP to send a “reset password email”: User management | n8n Docs

For this I created a snapshot of my droplet and created a new one for testing before doing it in the production site. This means that I also have to change the domain.

In summary I need:

  1. Change domain
  2. Configure SMTP
  3. Check that the changes have been made

I followed these steps for this:

  1. Open console in Digital Ocean
  2. Copy and paste this code:

But I got this error:

What am I doing wrong?

I am very new to n8n, docker, digital ocean, etc.

Thank you for your help.

Hi @illusionandcards

Can you run this command for me and post a screenshot?

docker ps

This command will show all the running containers. Let’s see if the n8n is running already.

1 Like

Here you have @mcnaveen

1 Like

It shows the n8n docker, right? Is there another way to change this configuration in a Digital Ocean’s Droplet?

1 Like

You just have to stop the running docker container and spin a new instance. Please note that running docker rm will remove the container

docker stop <Container_ID>
docker rm <Container_ID>

Now spin up a new instance with the additional env. (Add the SMTP option to the one you used to run earlier. Make sure to add SMTP env. (Also double check your original command)

docker run -it --rm \
 --name n8n \
 -p 5678:5678 \
 -e N8N_BASIC_AUTH_ACTIVE="true" \
 -e N8N_BASIC_AUTH_USER="<user>" \
 -e N8N_BASIC_AUTH_PASSWORD="<password>" \
 docker.n8n.io/n8nio/n8n
1 Like

If I remove the container, will I lose the workflows I’ve created with n8n? Or this will just reset the container.

The complete code I’ll have to run is:

docker run -it --rm \
 --name n8n \
 -p 5678:5678 \
-e N8N_BASIC_AUTH_ACTIVE="true" \
 -e N8N_BASIC_AUTH_USER="<user>" \
 -e N8N_BASIC_AUTH_PASSWORD="<password>" \
 -e N8N_EMAIL_MODE=smtp \
 -e N8N_SMTP_HOST=smtp.host \
 -e [email protected] \
 -e N8N_SMTP_PASS=SomePassword \
 -e [email protected] \
 -e WEBHOOK_URL=https://n8n.yourdomain.tld \
 -v ~/.n8n:/home/node/.n8n \
 docker.n8n.io/n8nio/n8n

And I’ll have fill the “” and “” with any information I want? Because I lost the password of the admin, that is why I am doing all this.

Thanks again @mcnaveen

If you have -v ~/.n8n:/home/node/.n8n in your previous command. The data will be stored and you won’t lose anything. If you don’t have it you’ll lose the data.

Do you mean that I have to run this command with the “-v ~/.n8n:/home/node/.n8n” before stoping and removing the container?

So the order would be:

  1. Run:
docker run -it --rm \
 --name n8n \
 -p 5678:5678 \
-e N8N_BASIC_AUTH_ACTIVE="true" \
 -e N8N_BASIC_AUTH_USER="<user>" \
 -e N8N_BASIC_AUTH_PASSWORD="<password>" \
 -e N8N_EMAIL_MODE=smtp \
 -e N8N_SMTP_HOST=smtp.host \
 -e [email protected] \
 -e N8N_SMTP_PASS=SomePassword \
 -e [email protected] \
 -e WEBHOOK_URL=https://n8n.yourdomain.tld \
 -v ~/.n8n:/home/node/.n8n \
 docker.n8n.io/n8nio/n8n
  1. Run:
docker stop <Container_ID>
docker rm <Container_ID>
  1. Run again:
docker run -it --rm \
 --name n8n \
 -p 5678:5678 \
-e N8N_BASIC_AUTH_ACTIVE="true" \
 -e N8N_BASIC_AUTH_USER="<user>" \
 -e N8N_BASIC_AUTH_PASSWORD="<password>" \
 -e N8N_EMAIL_MODE=smtp \
 -e N8N_SMTP_HOST=smtp.host \
 -e [email protected] \
 -e N8N_SMTP_PASS=SomePassword \
 -e [email protected] \
 -e WEBHOOK_URL=https://n8n.yourdomain.tld \
 -v ~/.n8n:/home/node/.n8n \
 docker.n8n.io/n8nio/n8n

I am sorry for asking that much, but this is difficult to understand for me.

Thanks for your time!

1 Like

In the terminal, if you run history it’ll show a list of commands you ran earlier. Please check that you have the below line in the n8n install command.

-v ~/.n8n:/home/node/.n8n

If you have, you won’t lose the data. Now run the below command to stop and remove the container.

docker stop <Container_ID>
docker rm <Container_ID>

Once removed, Run the below command to install n8n again. make sure to change the SMTP config.

docker run -it --rm \
 --name n8n \
 -p 5678:5678 \
 -e N8N_BASIC_AUTH_ACTIVE="true" \
 -e N8N_BASIC_AUTH_USER="<user>" \
 -e N8N_BASIC_AUTH_PASSWORD="<password>" \
 -e N8N_EMAIL_MODE=smtp \
 -e N8N_SMTP_HOST=smtp.host \
 -e [email protected] \
 -e N8N_SMTP_PASS=SomePassword \
 -e [email protected] \
 -e WEBHOOK_URL=https://n8n.yourdomain.tld \
 -v ~/.n8n:/home/node/.n8n \
 docker.n8n.io/n8nio/n8n

Hope this helps.

Worth adding… Looking at screenshot are you sure you are using the normal docker command not Docker Compose as that will change things.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.