diff --git a/.travis.yml b/.travis.yml
index e2eb2652df5f8895a35e2039d2e91b58d13a33d3..301394295ba0a45653b798d7bd6e8c9b90319c08 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -95,7 +95,7 @@ matrix:
   - name: Conda build, MacOS
     os: osx
     if: branch =~ ^test- OR tag IS present OR type IN(pull_request) OR type IN(cron)
-    osx_image: xcode8.3
+    osx_image: xcode9.2
     env: PLUMED_CONDA=yes
 # I don't put any mpi variant with macports since it takes too long to compile
 ## This command can be used to allow failures:
diff --git a/conda/plumed/conda_build_config.yaml b/conda/plumed/conda_build_config.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..adf47c2153fea1e57216b8b153d32a2e5f10bee6
--- /dev/null
+++ b/conda/plumed/conda_build_config.yaml
@@ -0,0 +1,2 @@
+CONDA_BUILD_SYSROOT:
+  - /var/tmp/MacOSX-SDKs/MacOSX10.9.sdk   # [osx]
diff --git a/conda/py-plumed/conda_build_config.yaml b/conda/py-plumed/conda_build_config.yaml
index 5bb1e33399a904cd2d420942594de692c181601c..716d0d3df63ac1b0982c39ca171160cfe1e4e87b 100644
--- a/conda/py-plumed/conda_build_config.yaml
+++ b/conda/py-plumed/conda_build_config.yaml
@@ -1,3 +1,5 @@
+CONDA_BUILD_SYSROOT:
+  - /var/tmp/MacOSX-SDKs/MacOSX10.9.sdk   # [osx]
 python:
     - 2.7
     - 3.6
diff --git a/conda/run-conda-build.sh b/conda/run-conda-build.sh
index 2b78e2456591f477d658a8d8cb4839b99a3f81f0..5382bdcdd99722fcca022e4f90e5fb6f9e5e6a19 100644
--- a/conda/run-conda-build.sh
+++ b/conda/run-conda-build.sh
@@ -9,6 +9,14 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
     csys=Linux
 elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
     csys=MacOSX
+    PREV=$(pwd)
+    cd /var/tmp
+    mkdir MacOSX-SDKs
+    cd MacOSX-SDKs
+    wget https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.9.sdk.tar.xz
+    tar -xf ./MacOSX10.9.sdk.tar.xz
+    rm MacOSX10.9.sdk.tar.xz
+    cd $PREV
 else
     echo "Unsupported system $TRAVIS_OS_NAME"
     exit 1