Question

How to setup wordpress updates on ubuntu 22.04 droplet and email configuration

Hello,

we have a droplet using ubuntu 22.04, the wordpress website is working fine but we cannot update versions or plugins through the admin panel… Can someone advise us what we might miss in our configuration? Also our mail function is not working neither even after setting up sendmail

Thanks!!


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
March 4, 2024

Heya,

The update of plugins will usually return response, either success or an error, if the message is not providing necessary information, you can examine the logs to extract additional data about the issue.

As for the emails, you can use an SMTP plugin and configure it with SMTP Host of your choice. Have in mind that SMTP restricted by default for new accounts since June 22, 2022.

https://www.digitalocean.com/blog/smtp-restricted-by-default

Regards

KFSys
Site Moderator
Site Moderator badge
March 3, 2024

Heya @ruthchaostudio,

Setting up WordPress updates on a droplet running Ubuntu 22.04 and configuring email can involve several steps. Here’s a general guide to help you troubleshoot and set up these features:

WordPress Updates Issue

  1. File Permissions: Ensure that WordPress has the correct file permissions to update itself. WordPress should have write permissions to the directories containing its files. You can set these permissions using the following commands:
sudo chown -R www-data:www-data /var/www/html
sudo find /var/www/html -type d -exec chmod 750 {} \;
sudo find /var/www/html -type f -exec chmod 640 {} \;

Replace /var/www/html with your WordPress installation directory.

If even afterwards you can’t update from your Admin Panel: Error Logs: Check the Apache/Nginx and PHP error logs for any relevant errors that might indicate what the problem is.

Email Configuration Issue

Since you mentioned that sendmail is not working, you might consider using an SMTP plugin for WordPress or configuring sendmail properly.

  1. Install an SMTP Plugin: Use a plugin like WP Mail SMTP by WPForms. This plugin allows you to configure WordPress to send emails using an SMTP service provider, which can be more reliable than using sendmail.

  2. Configuring sendmail:

    • Ensure sendmail is properly installed: sudo apt-get install sendmail
    • Run the Sendmail configuration with sudo sendmailconfig and follow the prompts.
    • Check for any errors in the mail log /var/log/mail.log for clues.
  3. Use External SMTP:

    • If sendmail is not a requirement, consider using an external SMTP service like Gmail, SendGrid
    • Configure this SMTP service in your WordPress settings (usually via a plugin) or in your php.ini file.
Bobby Iliev
Site Moderator
Site Moderator badge
March 2, 2024

Hey Ruth,

It sounds like you’re facing two separate issues: updating WordPress and its plugins and configuring email functionality on your Ubuntu 22.04 droplet. Let’s address each issue step by step.

WordPress Updates and Plugin Management

  1. File Permissions: The inability to update WordPress or plugins often stems from incorrect file permissions. Your web server should own the WordPress files and have the correct permissions to modify them.

    Set the correct permissions using the following commands. Replace www-data with your web server’s user if it’s different (Apache usually runs as www-data on Ubuntu).

    sudo chown -R www-data:www-data /var/www/html
    sudo find /var/www/html -type d -exec chmod 755 {} \;
    sudo find /var/www/html -type f -exec chmod 644 {} \;
    

    Adjust the path /var/www/html to match the directory of your WordPress installation.

  2. Configuration Check: Ensure that the wp-config.php file doesn’t explicitly define DISALLOW_FILE_MODS as true. This constant, when set to true, will disable the update and installation capability.

    define('DISALLOW_FILE_MODS', false);
    

Email Configuration with SendGrid

Since you’re facing issues with sendmail, I recommend using SendGrid for better deliverability and ease of use. Here’s how to integrate SendGrid with your WordPress site:

  1. Sign Up for SendGrid: If you haven’t already, create an account on SendGrid and set up a sender identity (this involves verifying your domain or email address).

  2. API Key: Generate an API key in SendGrid. This key will be used to authenticate your email requests from WordPress.

  3. Install a Plugin: Use a plugin like WP Mail SMTP by WPForms, which supports SendGrid. This plugin allows you to configure WordPress to send emails using the SendGrid API.

  4. Configure the Plugin:

    • Install and activate the WP Mail SMTP plugin.
    • Go to WP Mail SMTP settings in your WordPress dashboard.
    • Select SendGrid as your mailer.
    • Enter the API key you generated in SendGrid.
    • Save your settings and use the plugin’s built-in email test feature to ensure everything is working correctly.
  5. DNS Records: Follow SendGrid’s instructions to update your DNS records. This typically involves adding SPF and DKIM records to improve email deliverability and to help prevent your emails from being marked as spam.

If you encounter any specific errors during these processes or need further assistance, feel free to ask!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more