Answers.Body: <p>I setup Drupal and CiviCRM on my Digital Ocean Droplet by hand, but you'll face this issue regardless of how you setup.  This answer is sufficiently long and complex that I'm setting up a <a href="https://freephile.org/wiki/Email_Marketing">complete guide</a> on my wiki.</p>
  
  <p>DO does not allow <a href="https://warrenguy.me/blog/ipv6-digital-ocean-crippled">SMTP traffic on their IPv6 network</a>.  As a result, PHP applications that normally succeed in sending email will be unreliable, slow or outright fail.  CiviCRM is one that can be especially challenging to configure for outbound email at DO.  Although the simple mail() function appears to work, I don't think it offers the control or performance you might need.  In my case I wanted to use Google Apps for Business to send my email.</p>
  
  <p>The first thing you need to do is to set your hostname to a fully qualified domain name.  When you set your hostname to a FQDN, that will cause the DO system to create a PTR record in DNS for your host. Without a PTR record, many major email providers (Comcast/HotMail/Yahoo) will refuse to talk to your host and those messages will disappear into the void (check /var/log/mail.log). CiviCRM will report those messages as 'sent', but the recipient will never get it, not even in spam, because it never left your server.</p>
  
  <p>You must setup an A record for your FQDN at your DNS provider.  The PTR record should be automatically setup by Digital Ocean.</p>
  
  <pre><code>dig foo.example.com
  dig -x foo.example.com
  </code></pre>
  
  <p>Assuming you want to configure CiviCRM to use an external SMTP server such as Google Apps for Business (aka SMTP relay also known as smarthosting) you will suffer connection timeouts.  Some apps such as PHPMailer can be made to work with a hack using gethostbyname(), but the configuration for CiviCRM will only allow you to enter the hostname; and no permutation will work.  Instead, tell CiviCRM to use 'sendmail'.  Meanwhile sendmail is not actually installed.  <a href="https://freephile.org/wiki/Postfix">Postfix can be installed as the MTA and you can configure Postfix to send mail to Google</a>.  The 'hack' is to also bind Postfix to 0.0.0.0 so that it uses IPv4</p>
  
  <p>With the PTR record in place, and Postfix installed relaying SMTP to your provider over an IPv4 network, and CiviCRM set to use 'sendmail' you can now use your CiviMail.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-12T04:12:07.867Z
Answers.Text: Interesting.  We are running on Digital Ocean and don't have any of the mail issues.  We use SMTP to a private server.  If I remember correctly, we tried using google but because of their limits on how many messages can be sent, we went with the private server, but maybe we had timeout issues as well.  For what it's worth that server is running qmail.
Answers.UserDisplayName: Paul-Tahoe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-13T20:47:21.187Z
Answers.Text: Paul-Tahoe, it's not clear to me how you setup your DO environment and configured CiviCRM.  Are you saying that you have qmail running as the MTA on your droplet, and configured CiviCRM to use qmail in the SMTP options for outbound email settings? Are you also saying that qmail is configured to relay to an external service (such as SendGrid or Dyn)?
Answers.UserDisplayName: Greg Rundlett
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-14T06:03:49.107Z
Answers.Text: Our droplet doesn't have IPv6 enabled and we are using an an external service so to speak.  The external service is really a private server running at a friendly person's house with fiber.  Unfortunately, they are moving that server onto shared hosting which won't allow the smtp relaying so we'll have to move to a external service.
Answers.UserDisplayName: Paul-Tahoe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-12T03:52:47.350Z
Answers.LastActivityDate: 2015-08-12T03:52:47.350Z
Answers.UserDisplayName: Greg Rundlett
Answers.Body: <p>I've been running several CiviCRM sites on DigitalOcean for the past year and have been quite happy. I've been using Nginx, MariaDB,and PHP-FPM to serve both WordPress and Drupal instances. While I've never used their one-click installations, they should work just fine assuming you're comfortable working in a Linux environment.</p>
  
  <p>As Greg mentions,you may experience problems if you try to send on a server with IPv6 enabled. IPv6 is given priority over IPv4, so if you want to send from a DigitalOcean server you'll want to considering disabling IPv6 or force your MTA to use IPv4. I've gotten around this at times by using Mandrill for my transaction emails.</p>
  
  <p>I've found services like Mandrill and Sendgrid much more convenient than configuring and maintaining my own mail server. The quotas they offer free users are quite generous so most sites are unlikely to burn through it. There's an extension to take advantage of Mandrill's webhooks that is helpful too.</p>
  
  <p>If you opt to serve CiviCRM using a <a href="https://lemp.io">LEMP stack</a>, you should keep in mind that Nginx doesn't use .htaccess so you'll need to adjust your server block(s) accordingly. I'm beginning to compile <a href="https://github.com/jbradach/civicrm-nginx">sample configurations for deploying CiviCRM with Nginx</a>, but this is very much a work in progress.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-19T03:38:50.500Z
Answers.LastActivityDate: 2015-09-19T03:38:50.500Z
Answers.UserDisplayName: James Bradach
Body: <p>DigitalOcean provides one-click installation of WP, Drupal and CiviCRM. I hope this question can collect experiences with it to help others.</p>
  
  <ul>
  <li>What additional considerations are there for hosting CiviCRM on DigitalOcean?</li>
  <li>Are there any specific configurations or patches required?</li>
  <li>Is there any functionality which differs from hosting CiviCRM on a "standard" LAMP stack?</li>
  </ul>
  
Tags: <hosting><hosting-providers><digitalocean>
Title: What is required to run CiviCRM on DigitalOcean?
ThreadText: # What is required to run CiviCRM on DigitalOcean?
  
  (Asked by: username_0 on 2015-08-12)
  
  DigitalOcean provides one-click installation of WP, Drupal and CiviCRM. I hope this question can collect experiences with it to help others.
  
  * What additional considerations are there for hosting CiviCRM on DigitalOcean?
  * Are there any specific configurations or patches required?
  * Is there any functionality which differs from hosting CiviCRM on a "standard" LAMP stack?
  
  **Tags:** hosting, hosting-providers, digitalocean
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-08-12. Score: 7
  
  I setup Drupal and CiviCRM on my Digital Ocean Droplet by hand, but you'll face this issue regardless of how you setup.  This answer is sufficiently long and complex that I'm setting up a complete guide on my wiki.
  DO does not allow SMTP traffic on their IPv6 network.  As a result, PHP applications that normally succeed in sending email will be unreliable, slow or outright fail.  CiviCRM is one that can be especially challenging to configure for outbound email at DO.  Although the simple mail() function appears to work, I don't think it offers the control or performance you might need.  In my case I wanted to use Google Apps for Business to send my email.
  The first thing you need to do is to set your hostname to a fully qualified domain name.  When you set your hostname to a FQDN, that will cause the DO system to create a PTR record in DNS for your host. Without a PTR record, many major email providers (Comcast/HotMail/Yahoo) will refuse to talk to your host and those messages will disappear into the void (check /var/log/mail.log). CiviCRM will report those messages as 'sent', but the recipient will never get it, not even in spam, because it never left your server.
  You must setup an A record for your FQDN at your DNS provider.  The PTR record should be automatically setup by Digital Ocean.
  dig foo.example.com
  dig -x foo.example.com
  
  Assuming you want to configure CiviCRM to use an external SMTP server such as Google Apps for Business (aka SMTP relay also known as smarthosting) you will suffer connection timeouts.  Some apps such as PHPMailer can be made to work with a hack using gethostbyname(), but the configuration for CiviCRM will only allow you to enter the hostname; and no permutation will work.  Instead, tell CiviCRM to use 'sendmail'.  Meanwhile sendmail is not actually installed.  Postfix can be installed as the MTA and you can configure Postfix to send mail to Google.  The 'hack' is to also bind Postfix to 0.0.0.0 so that it uses IPv4
  With the PTR record in place, and Postfix installed relaying SMTP to your provider over an IPv4 network, and CiviCRM set to use 'sendmail' you can now use your CiviMail.
  
  > **Comments:**
  > **username_2**: Interesting.  We are running on Digital Ocean and don't have any of the mail issues.  We use SMTP to a private server.  If I remember correctly, we tried using google but because of their limits on how many messages can be sent, we went with the private server, but maybe we had timeout issues as well.  For what it's worth that server is running qmail.  
  > **username_1**: username_2, it's not clear to me how you setup your DO environment and configured CiviCRM.  Are you saying that you have qmail running as the MTA on your droplet, and configured CiviCRM to use qmail in the SMTP options for outbound email settings? Are you also saying that qmail is configured to relay to an external service (such as SendGrid or Dyn)?  
  > **username_2**: Our droplet doesn't have IPv6 enabled and we are using an an external service so to speak.  The external service is really a private server running at a friendly person's house with fiber.  Unfortunately, they are moving that server onto shared hosting which won't allow the smtp relaying so we'll have to move to a external service.  
  
  ---
  
  ### Answer by username_3 on 2015-09-19. Score: 5
  
  I've been running several CiviCRM sites on DigitalOcean for the past year and have been quite happy. I've been using Nginx, MariaDB,and PHP-FPM to serve both WordPress and Drupal instances. While I've never used their one-click installations, they should work just fine assuming you're comfortable working in a Linux environment.
  
  As Greg mentions,you may experience problems if you try to send on a server with IPv6 enabled. IPv6 is given priority over IPv4, so if you want to send from a DigitalOcean server you'll want to considering disabling IPv6 or force your MTA to use IPv4. I've gotten around this at times by using Mandrill for my transaction emails.
  
  I've found services like Mandrill and Sendgrid much more convenient than configuring and maintaining my own mail server. The quotas they offer free users are quite generous so most sites are unlikely to burn through it. There's an extension to take advantage of Mandrill's webhooks that is helpful too.
  
  If you opt to serve CiviCRM using a [LEMP stack](https://lemp.io), you should keep in mind that Nginx doesn't use .htaccess so you'll need to adjust your server block(s) accordingly. I'm beginning to compile [sample configurations for deploying CiviCRM with Nginx](https://github.com/jbradach/civicrm-nginx), but this is very much a work in progress.
  
  
  ---
  
  