How to Run IronPDF for Java in Google Cloud

Darrius Serrant
Darrius Serrant
January 22, 2023
Updated October 20, 2024
Share:

Note: We have not fully tested support with Google Cloud but if you want to try, we have some Required Settings.

Important: Required Settings

  • Zip Deployment is not supported, since IronPDF requires execution of binaries at runtime.
  • Default Cloud Function Docker images are not working because they lack the required packages required for Chrome to run properly. For more information, see the Google Cloud System Packages.
  • Please use a custom Dockerfile and install all required packages. Learn more about this in our Linux Deployment Guide.
  • Include the ironpdf-engine-linux-x64 dependency to your project: (change the version number to latest)

    <dependency>
        <groupId>com.ironsoftware</groupId>
        <artifactId>ironpdf-engine-linux-x64</artifactId>
        <version>2022.xx.x</version>
    </dependency>
    XML
  • This plugin may be required:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.4</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
    
                <!--  required for Docker-->
                <configuration>
                    <transformers>
                        <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                    </transformers>
                </configuration>
    
            </execution>
        </executions>
    </plugin>
    XML
  • These dependencies may be required:

    <dependency>
        <groupId>io.perfmark</groupId>
        <artifactId>perfmark-api</artifactId>
        <version>0.26.0</version>
    </dependency>
    
    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-okhttp</artifactId>
        <version>1.50.2</version>
    </dependency>
    
    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-netty-shaded</artifactId>
        <version>1.50.2</version>
    </dependency>
    XML
  • Set timeout to 330 seconds due to slow start.
  • Set memory size to at least 2048 MB.
  • Set EphemeralStorage Size to at least 1024 MB.
  • In some environments, you may need to point at an IronPdfEngineWorkingDirectory and set execution permissions for it:

    Setting.setIronPdfEngineWorkingDirectory(Paths.get("/tmp/"));
    JAVA
    RUN chmod 777 /tmp/
Darrius Serrant
Full Stack Software Engineer (WebOps)

Darrius Serrant holds a Bachelor’s degree in Computer Science from the University of Miami and works as a Full Stack WebOps Marketing Engineer at Iron Software. Drawn to coding from a young age, he saw computing as both mysterious and accessible, making it the perfect medium for creativity and problem-solving.

At Iron Software, Darrius enjoys creating new things and simplifying complex concepts to make them more understandable. As one of our resident developers, he has also volunteered to teach students, sharing his expertise with the next generation.

For Darrius, his work is fulfilling because it is valued and has a real impact.