Backstepping design for boundary linear PDE is formulated as a convex optimization problem. Some classes of parabolic PDEs and a first-order hyperbolic PDE are studied, with particular attention to non-strict feedback structures. Based on the compactness of the Volterra and Fredholm-type operators involved, their Kernels are approximated via polynomial functions. The resulting Kernel-PDEs are optimized using Sumof-Squares (SOS) decomposition and solved via semidefinite programming, with sufficient precision to guarantee the stability of the system in the L 2-norm. This formulation allows optimizing extra degrees of freedom where the Kernel-PDEs are included as constraints. Uniqueness and invertibility of the Fredholm-type transformation are proved for polynomial Kernels in the space of continuous functions. The effectiveness and limitations of the approach proposed are illustrated by numerical solutions of some Kernel-PDEs.