Accidentally removed Cert

I want to remove this domain
but I did it manually.

I ran this command: rm -r /etc/letsencrypt/live/

can't start the nginx due to this error: systemd[1]: Starting A high performance web server and a reverse proxy server...
nginx[2264]: nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/>
nginx[2264]: nginx: configuration file /etc/nginx/nginx.conf test failed
systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
systemd[1]: nginx.service: Failed with result 'exit-code'.
systemd[1]: Failed to start A high performance web server and a reverse proxy s>

My web server is (include version): ubuntu 20.4

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 0.40.0

I don't need that cert anymore that's why I deleted it but
upon researching it should not be manually deleted :frowning:

The contents of the /live/ directory are symlinks to the most recent files in the corresponding /archive/ directory. You can manually recreate the symbolic links.


Hello, there are no files in /etc/letsencrypt/archive.

can you please elaborate on manually recreating the symbolic links?

1 Like

Where did the content of that directory go?

That's of no use if there are no contents in the /archive/ directory. In that case you need to use a backup or, if no backup is available, issue a new certificate.


Please don't do anything like that [ever again].
Whatever you are trying to do, there should be an instruction for certbot to do it for you [correctly].


I mean there's a folder in archive but other domain name not :frowning:

I also tried to issue a new cert with but still same error I got >.<

Yes I will take note of that sir in my life, Thanks!

1 Like

How bout reinstalling the nginx and certbot?

Would you show output of this? We can probably fix the damage

ls -l /etc/letsencrypt/{live,archive,renewal}

And, don't just try to reinstall certbot. It won't help. What you have is an nginx config problem because you deleted files it still requires.


Here sir:

total 4
drwxr-xr-x 2 root root 4096 Sep 10 12:08

total 12
-rw-r--r-- 1 root root 740 Feb 8 2022 README
drwxr-xr-x 2 root root 4096 Sep 19 08:12
drwxr-xr-x 2 root root 4096 Sep 10 12:08

total 4
-rw-r--r-- 1 root root 582 Sep 10 12:08

btw I tried to recreate the cert of

Ok, now please show:

ls -l /etc/letsencrypt/live/

And also

ls -l /etc/letsencrypt/live/

ls -l /etc/letsencrypt/live/
total 0

Sorry, was too late, also this:

ls -l /etc/letsencrypt/live/

ls -l /etc/letsencrypt/live/
total 4
-rw-r--r-- 1 root root 692 Feb 8 2022 README
lrwxrwxrwx 1 root root 49 Sep 10 12:08 cert.pem -> ../../archive/
lrwxrwxrwx 1 root root 50 Sep 10 12:08 chain.pem -> ../../archive/
lrwxrwxrwx 1 root root 54 Sep 10 12:08 fullchain.pem -> ../../archive/
lrwxrwxrwx 1 root root 52 Sep 10 12:08 privkey.pem -> ../../archive/

OK, just one more but it's long. Then I can give good advice on what to do.

Please show result of sudo nginx -T (skip sudo if you don't need it). Place 3 backticks before and after the output like
output of: sudo nginx -T

Or, upload the txt file created by doing sudo nginx -T >upload.txt


sure btw Thanks a lot for your time sir!

nginx: configuration file /etc/nginx/nginx.conf test failed```

[upload.txt|attachment](upload://fprEVGUMf2UMGFJrVQzYCl7p3d.txt) (382 Bytes)

Oh, right, ack. OK, can you upload the nginx.conf file (might have to copy it to .txt file)

1 Like

noted sir

nginx.conf.txt (1.9 KB)

thanks. Give me a minute



ls -l /etc/nginx/conf.d/*.conf
ls -l /etc/nginx/sites-enabled