With an interest only mortgage, your payments to the lender cover only the interest on the loan (i.e. they do not repay any of the capital). The total amount of your debt does not reduce over time and the full amount of the loan still has to be repaid to the lender at the end of the term, so you will need to ensure you have that money ready.
So you can make this final payment, you can invest so that you generate enough capital to repay the loan at the end of the term. If you choose to invest, some investment vehicles can have tax advantages and when you move or remortgage, your investment vehicle can usually be reallocated to the new mortgage.
However, there is no guarantee that your chosen investment vehicle will grow sufficiently to repay your loan (although you can usually top up your contributions to investments as you go along if this looks likely to be the case).